Repository navigation
Apply style rules inside true @supports blocks - #275
Merged
Merged
Conversation
eXpl0it3r
force-pushed
the
fix/supports-rules
branch
from
November 10, 2026 19:06
93945d9 to
7341161
Compare
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.
Style rules inside an
@supportsblock never applied, no matter what the condition evaluated to. With@supports (display: block) { p { color: red } }the paragraph stayed black, while the same rule inside@media screenworked. The rule index inCssDataonly descended into@media,@layerand nested style rules and silently skipped@supports, even thoughFlattenRulesright above it already handled it.IndexRulesnow evaluates the@supportscondition and indexes the inner rules when it's true. The condition doesn't depend on the viewport, so it's decided once while building the index, and nested@mediablocks inside it keep their media matching as before. This also covers@supportsinside@layerand nested@supports/@mediacombinations. What a condition evaluates to isn't touched, e.g.animation-nameis still reported as supported, so the portedSupportsNot_Fallback_Applies_WhenFeatureIsUnsupportedtest stays ignored for that reason.How to test this PR?
CI should succeed. The tests in
ConditionGroupingRuleIntegrationTestscover true and false conditions,not, nesting with@mediaand@supportsinside@layer, and the ones expecting the inner rules to apply fail on master.