- From: Christoph Päper via GitHub <noreply@w3.org>
- Date: Fri, 20 Feb 2026 17:35:57 +0000
- To: public-css-archive@w3.org
Crissov has just created a new issue for https://github.com/w3c/csswg-drafts:
== [css-style-attr] Level 2 or stable forever? ==
[CSS Style Attributes](https://www.w3.org/TR/css-style-attr/) has been a Recommendation since 2013-11-07. It consists of hardly more than boilerplate and stating the obvious by reciting the grammar for its attribute value:
~~~~ ebnf
declaration-list
: S* declaration? [ ';' S* declaration? ]*
;
~~~~
I would have assumed that the [ED](https://drafts.csswg.org/css-style-attr/) would be equal to that state, because it bears no sign of being a more recent level. Alas, it is currently dated 2015-04-15, i.e. about one and a half years later than the REC, but names the 2013-10-03 PR as its preceding version, both at the top and in its [Changes section](https://drafts.csswg.org/css-style-attr-1/#changes). The differences mentioned there apparently never made it into the published specification:
> Parse at-rules in declaration lists to allow future extension.
~~~~ ebnf
style-attribute
: S* declaration-list
;
declaration-list
: declaration [ ';' S* declaration-list ]?
| at-rule declaration-list
| /* empty */
;
~~~~
I believe the Level 1 ED should be reset to what the REC says, unless this difference is considered an erratum. In the latter case, the WG should strive to finally publish this in `/TR`. Otherwise, if it still seems relevant, it should become part of a newly created **CSS Style Attributes Level 2 ED**, which would also address that there now are indeed at-rules within declaration blocks – `@media` in particular – and even [nested](https://drafts.csswg.org/css-nesting-1/#syntax) style blocks with `&` selectors.
Note that as it stands, at least in theory, a CSS-enabled user agent does not have to support Selectors at all for styling a document language with a `style` attribute –and absolutely no at-rules either. (That could be another argument why it is a bad idea to introduce selectors on the right-hand side of the colon.)
I think I remember proposals from 15+ years ago that asked for pseudo-class support within `style` attributes. The text in css-nesting and [css-syntax](https://drafts.csswg.org/css-syntax/#block-contents), however, read as if nested selectors have been deliberately omitted from attribute values, since `<declaration-list>` excludes at-rules and ”qualified rules“.
I am surprised that not more authors assume that nested rules worlds work in `style` attributes.
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13540 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 20 February 2026 17:35:58 UTC