-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
refactor(dry): duplicates, if one property for multiple selectors #1196
Comments
Thanks, you fill the issue very good. It is good, that you found it :). But this behavior was added with a purpose. We can’t generate |
@ai , Status: 😿 Not fixed 1. ApologiesSorry, this code from 3.1 item of my example will not work: .KiraFirst, .KiraSecond, .KiraThird::-webkit-input-placeholder, .KiraThird:-ms-input-placeholder, .KiraThird::-ms-input-placeholder, .KiraThird::placeholder {
color: yellow
} But Autoprefixer still create duplicates and it still possible to solve. 2. Expected behaviorNo 2.1. Sources<textarea class="KiraThird" placeholder="Kira Goddess"></textarea> .KiraFirst, .KiraSecond, .KiraThird::placeholder {
color: red
}
.KiraThird::-webkit-input-placeholder {
color: red
}
.KiraThird:-ms-input-placeholder {
color: red
}
.KiraThird::-ms-input-placeholder {
color: red
} 2.2. ResultTested in Firefox and Edge, that required 3. Not helpedI can't find the tool, that automatically fix this problem. I try cssnano and css-purge. Thanks. |
Good idea |
Do you want to add great open source contribution to your resume? To add this feature you need to fix this file |
While working on this issue i found probably a bug. .KiraFirst, .KiraSecond, .KiraThird::placeholder, a::selection {
color: yellow
} The output is probably not what we expect: .KiraFirst, .KiraSecond, .KiraThird::placeholder, a::-moz-selection {
color: yellow
}
.KiraFirst, .KiraSecond, .KiraThird::placeholder, a::-webkit-selection {
color: yellow
}
undefined {
color: yellow
}
.KiraFirst, .KiraSecond, .KiraThird::placeholder, a::-ms-selection {
color: yellow
}
.KiraFirst, .KiraSecond, .KiraThird::placeholder, a::selection {
color: yellow
} |
Yeap seems like we have a bug here. |
I was about to say how splitting the rule into multiple copies is not a bug but then I saw the Yep, that's a bug 😅 |
It's not only about |
Thanks for the report and review. The fix was released in 9.6.5. |
1. Summary
If one property for multiple selectors in CSS:
PostCSS Autoprefixer generate duplicates.
2. MCVE
KiraAutoprefixer.css
:3. Behavior
3.1. Expected
3.2. Actual
.KiraFirst
and.KiraSecond
repeat.4. Argumentation
For example, Autoprefixer add to my real file ~60 selectors duplicates because of different
::placeholder
prefixes:Thanks.
The text was updated successfully, but these errors were encountered: