This proposal extends the DocumentOrShadowRoot
mixin with a new method getCascadeLayers()
, which returns the names of all the CSS cascade layers defined in the tree scope, sorted by the layer ordering.
DocumentOrShadowRoot.getCascadeLayers()
allows browser DevTools to present a visualization of all layers, for example:
Without this extension, DevTools have to manually collect the @layer
rules from the stylesheets and reconstruct the full layer names and the sorted layer ordering.