[csswg-drafts] Centralize definition for handling multiple descriptor declarations of the same name (#12979)

cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts:

== Centralize definition for handling multiple descriptor declarations of the same name ==
(Follow-up to https://github.com/w3c/csswg-drafts/issues/12977#issuecomment-3419932394.)

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`](https://drafts.csswg.org/css-counter-styles-3/#at-ruledef-counter-style), [`@font-face`](https://drafts.csswg.org/css-fonts-4/#at-font-face-rule), [`@font-palette-values`](https://drafts.csswg.org/css-fonts-4/#at-ruledef-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`](https://drafts.csswg.org/css-fonts-4/#at-ruledef-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`](https://drafts.csswg.org/css-color-5/#at-ruledef-profile), [`@position-try`](https://drafts.csswg.org/css-anchor-position-1/#at-ruledef-position-try), [`@property`](https://drafts.css-houdini.org/css-properties-values-api/#at-property-rule), [`@view-transition`](https://drafts.csswg.org/css-view-transitions-2/#at-view-transition-rule).

If I am not mistaken, [`@page` and margin rules](https://drafts.csswg.org/css-page-3/#cascading-and-page-context) 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](https://drafts.csswg.org/cssom-1/#concept-declarations-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".

@SebastianZ 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12979 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 20 October 2025 09:19:04 UTC