-
Notifications
You must be signed in to change notification settings - Fork 759
Description
(Follow-up to #12977 (comment).)
When there are multiple declarations of the same descriptor, the declaration with the greatest cascading order, or the last one if they do not cascade, always wins.
The idea is therefore to establish a term to which the definitions of these rules accepting descriptors can refer, unless they define a different handling.
This default handling is clearly defined for @counter-style, @font-face, @font-palette-values, with a prose similar to this:
When a given descriptor occurs multiple times, only the last specified valid value is used; all prior values for that descriptor must be ignored.
For declarations in rules nested in @font-feature-values, it is basically equivalent.
It is unspecified for @font-feature-values (which only accepts font-display as a descriptor, which is debated in #2973), @color-profile, @position-try, @property, @view-transition.
If I am not mistaken, @page and margin rules are the only at-rules whose descriptor declarations are defined as cascading: the one with the greatest cascading order wins.
For @function and @mixin, I am not sure but from testing in Chrome, the last one seems to win.
A while ago, I suggested (#9821) to always apply the specified order at the syntax level. But I do not think I considered the idea that a rule might need to define "the first declaration wins".