Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added blocker -moz- for ::file-selector-button #1421

Merged
merged 3 commits into from Aug 26, 2021
Merged

Added blocker -moz- for ::file-selector-button #1421

merged 3 commits into from Aug 26, 2021

Conversation

usmanyunusov
Copy link
Contributor

No description provided.

@ai
Copy link
Member

ai commented Aug 25, 2021

We also need to change tests.

We need a TDD here:

  1. Revert fix
  2. Find a way to reproduce bug in the tests
  3. Add a fix to be sure that it fix the bug

You may need to use another browsers in the test.

@usmanyunusov
Copy link
Contributor Author

usmanyunusov commented Aug 26, 2021

@ai, Replaced the test:

let fileSelectorButtoner = autoprefixer({
  overrideBrowserslist: ['Chrome > 25', 'Firefox >= 82']
})

Test fail:

@@ -1,22 +1,34 @@
  ::-webkit-file-upload-button {
    background: black
  }

+ ::-moz-file-selector-button {
+   background: black
+ }
+
  ::file-selector-button {
    background: black
  }

  input::-webkit-file-upload-button {
    color: black;
  }

- input::file-selector-button {
+ input::-moz-file-selector-button {
    color: black;
  }

- input:hover::-webkit-file-upload-button {
+ input::file-selector-button {
+   color: black;
+ }
+
+ input:hover::-webkit-file-upload-button {
+   color: white;
+ }
+
+ input:hover::-moz-file-selector-button {
    color: white;
  }

  input:hover::file-selector-button {
    color: white;

@ai
Copy link
Member

ai commented Aug 26, 2021

Send test changes to PR

@usmanyunusov
Copy link
Contributor Author

I suggest replacing all prefixes with a -webkit-

class FileSelectorButton extends Selector {
 constructor(name, prefixes, all) {
    super(name, prefixes, all)

    if (this.prefixes) {
      this.prefixes = utils.uniq(
        this.prefixes.map(i => {
          return '-webkit-'
        })
      )
    }
  }

@ai
Copy link
Member

ai commented Aug 26, 2021

Yeap, let’s try.

@ai ai merged commit e75889e into postcss:main Aug 26, 2021
@ai
Copy link
Member

ai commented Aug 26, 2021

The fix was released in 10.3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants