@import "style1.css" layer(layer-1);
@import "style2.css" layer;
@import "style3.css";CSSImportRule: layerName property / notebook
CSSImportRule: layerName property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const myRules = document.styleSheets[0].cssRules;
console.log(myRules[0].layerName); // returns `"layer-1"`
console.log(myRules[1].layerName); // returns `""` (an anonymous layer)
console.log(myRules[2].layerName); // returns `null`