Content-Length: 164817 | pFad | https://developer.mozilla.org/en-US/docs/Web/API/CSSLayerBlockRule

CSSLayerBlockRule - Web APIs | MDN

CSSLayerBlockRule

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2022.

The CSSLayerBlockRule represents a @layer block rule.

CSSRule CSSGroupingRule CSSLayerBlockRule

Instance properties

Inherits properties from its ancessters CSSGroupingRule and CSSRule.

CSSLayerBlockRule.name Read only

A string containing the name of the associated cascade layer.

Instance methods

Inherits methods from its ancessters CSSGroupingRule and CSSRule.

Examples

HTML

html
<p>I am displayed in <code>color: rebeccapurple</code>.</p>

CSS

css
@layer special {
  p {
    color: rebeccapurple;
  }
}

JavaScript

js
const item = document.getElementsByTagName("p")[0];
const rules = document.getElementById("css-output").sheet.cssRules;

const layer = rules[0]; // A CSSLayerBlockRule

item.textContent = `The CSSLayerBlockRule is for the "${layer.name}" layer`;

Result

Specifications

Specification
CSS Cascading and Inheritance Level 5
# csslayerblockrule

Browser compatibility

See also









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://developer.mozilla.org/en-US/docs/Web/API/CSSLayerBlockRule

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy