MDN The allCSSshorthand property resets all of an element's properties except unicode-bidi, direction, and CSS Custom Properties. It can set properties to their initial or inherited values, or to the values specified in another cascade layer or stylesheet origin.
<section id="default-example"> <div class="example-container-bg"> <div class="example-container"> <p id="example-element"> This paragraph has a font size of 1.5rem and a color of gold. It also has 1rem of vertical margin set by the user-agent. The parent of the paragraph is a <div> with a dashed blue border. </p> </div> </div></section>
At-ruleBaseline: widely availablesince January 2018
Spec The @import rule allows users to import style rules from other style sheets. If an @import rule refers to a valid stylesheet, user agents must treat the contents of the stylesheet as if they were written in place of the @import rule, with two exceptions:
MDN The @importCSSat-rule is used to import style rules from other valid stylesheets. An @import rule must be defined at the top of the stylesheet, before any other at-rule (except @charset and @layer) and style declarations, or it will be ignored.
Spec Scoped styles are described in CSS using the @scope block at-rule, which declares a scoping root and optional scoping limits associated with a set of style rules.
MDN The @scopeCSSat-rule enables you to select elements in specific DOM subtrees, targeting elements precisely without writing overly-specific selectors that are hard to override, and without coupling your selectors too tightly to the DOM structure.
Live previewExample from MDN
div { padding: 10px;}@scope (.light-scheme) { :scope { background-color: plum; } a { color: darkmagenta; }}@scope (.dark-scheme) { :scope { background-color: darkmagenta; color: antiquewhite; } a { color: plum; }}
<div class="light-scheme"> <p> MDN contains lots of information about <a href="/en-US/docs/Web/HTML">HTML</a>, <a href="/en-US/docs/Web/CSS">CSS</a>, and <a href="/en-US/docs/Web/JavaScript">JavaScript</a>. </p></div><div class="dark-scheme"> <p> MDN contains lots of information about <a href="/en-US/docs/Web/HTML">HTML</a>, <a href="/en-US/docs/Web/CSS">CSS</a>, and <a href="/en-US/docs/Web/JavaScript">JavaScript</a>. </p></div>
Syntax
@scope <scope-boundaries>? { <block-contents> }
Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.
Browser support
First browser version supporting @scope
Chrome
118
Edge
118
Firefox
146
Safari
26.4
Chrome Android
118
Safari iOS
26.4
First version with support, from MDN browser-compat-data.