Email or username:

Password:

Forgot your password?
Bramus

I’m having fun building this `CSSRule` debugger to show you what goes on behind the scenes of a CSS engine.

codepen.io/bramus/full/JjgXWNJ

Especially handy with `CSSNestedDeclarations` coming to the CSSOM in Chrome 130, Firefox 132, and (possibly) Safari 18.1.

Screenshot of Chrome 129, which does not have CSSNestedDeclarations support.
Screenshot of Chrome 130, which has CSSNestedDeclarations support.
4 comments
Kilian Valkhof

@bramus Is there somewhere I can follow along with that? is CSSNestedDeclarations solely for that declaration-after-other-nesting situation?

That specificity attribute, is that a you-think or is that also coming natively?

Bramus

@Kilian Awaiting the blog post I am currently finishing, you can check the spec [^1] which has some info boxes on why you need `CSSNestedDeclarations`.

Mainly to fix the shifting up behavior but also some other side-effects from before.

I manually added the `specificity` and `resolvedSelectorText` attributes for demonstration purposes. Added a note in the demo itself to clarify that.

[^1]: drafts.csswg.org/css-nesting/#

Kilian Valkhof

@bramus if you ever make a CSSWG proposal for that you have my +1 ;)

Kilian Valkhof

@bramus I like this solution a lot, but as a devtools builder it's annoying the number of in-flight revisions nesting is getting ;)

Go Up