Repository navigation
Remove outdated prefixed values before a different unprefixed value - #1576
Open
draarivpatel-ui wants to merge 1 commit into
Open
draarivpatel-ui wants to merge 1 commit into
draarivpatel-ui wants to merge 1 commit into
Conversation
When cleaning up prefixes, a prefixed value was only removed if a later declaration in the same rule repeated the unprefixed form of the same value. A declaration like display: -ms-flexbox followed by display: none was kept as if it were an intentional hack. But a later unprefixed declaration of the same property wins the cascade in every browser that understands it, so the outdated prefixed declaration can never apply there, no matter what value it carries. Lone prefixed hacks without any unprefixed declaration are still preserved. Fixes postcss#1461
Member
|
What is your use case? If it is just idea from LLM agent and without real use case, we don't need it (too risky to break something new) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When autoprefixer removes outdated prefixes, a prefixed value declaration was only dropped when a later declaration in the same rule repeated the unprefixed form of that same value. From the issue:
kept both prefixed lines with an empty browserslist, because
nonedoes not repeat the unprefixed valueflex, so the declarations looked like intentional vendor hacks.A later unprefixed declaration of the same property always wins the cascade in browsers that understand it, so the outdated prefixed declaration can never apply there, regardless of which value it carries. The removal check now also treats a later unprefixed declaration of the same property as covering the prefixed one. Lone prefixed hacks that have no unprefixed declaration at all (the behavior
test/cases/value-hack.csspins down) are still preserved.Fixes #1461
Test plan
test/autoprefixer.test.js: the reproduction from the issue now cleans up todisplay: none, and a lone prefixed hack without an unprefixed declaration is still preserved.uvu).