postcss / autoprefixer

Parse CSS and add vendor prefixes to rules by Can I Use
https://twitter.com/autoprefixer
MIT License
21.58k stars 1.25k forks source link

Multiple ::file-selector-button Issue #1419

Closed Woedenaz closed 2 years ago

Woedenaz commented 2 years ago

Hey there! I'm having an issue with the latest release.

So, let's say I have:

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

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

When it is run through autoprefixer (with any browserslist, as far as I can tell), it results in:

input:hover::-webkit-file-upload-button {
    color: white;
}

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

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

Sometimes it's just the first two, depending on the browsers list. Regardless, it always removes anything before the last instance of ::file-selector-button. Even if I have two different selections.

For instance, if I have:

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

div > input::file-selector-button {
    color: black;
}

it will output:

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

div > input::file-selector-button {
    color: black;
}

div > input::file-selector-button {
    color: black;
}

I've tried everything I can think of to circumvent this but I'm unsure what to do at this point. Any help would be most appreciated!

ai commented 2 years ago

Autoprefixer Yeap. We have a strange bug. I will try to look during next week.

usmanyunusov commented 2 years ago

PR: https://github.com/postcss/autoprefixer/pull/1420

ai commented 2 years ago

The fix was released in 10.3.2