Candidate Recommendation Snapshot · css-cascade

CSS Cascading and Inheritance

1 property, 3 at-rules defined by this specification, all known to at least one browser .

Each feature in detail

all

Property Baseline: widely availablesince July 2022

MDN The all CSS shorthand 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.

Live preview Example from MDN
#example-element {
  color: gold;
  padding: 10px;
  font-size: 1.5rem;
  text-align: left;
  width: 100%;
}

.example-container {
  border: 2px dashed #2d5ae1;
}

.example-container-bg {
  background-color: #77767b;
  padding: 20px;
}

Syntax

initial | inherit | unset | revert | revert-layer | revert-rule

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
see individual properties
Applies to
see individual properties
Inherited
see individual properties
Percentages
see individual properties
Computed value
see individual properties
Canonical order
per grammar
Animation type
see individual properties

Browser support

First browser version supporting all
Chrome 37
Edge 79
Firefox 27
Safari 9.1
Chrome Android 37
Safari iOS 9.3

First version with support, from MDN browser-compat-data.

@import

At-rule Baseline: 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 @import CSS at-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.

Syntax

@import [ <url> | <string> ] [[ layer | layer( <layer-name> ) ] || [ scope | scope( <scope-start> | <scope-boundaries> ) ] || <supports-import-condition>]? <media-import-condition> ;

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 @import
Chrome 1
Edge 12
Firefox 1
Safari 1
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

@layer

At-rule Baseline: widely availablesince September 2024

Spec The @layer rule declares a cascade layer, with the option to assign style rules.

MDN The @layer CSS at-rule is used to declare a cascade layer and can also be used to define the order of precedence in case of multiple cascade layers.

Live preview Example from MDN
@layer module, state;

@layer state {
  .alert {
    background-color: brown;
  }
  p {
    border: medium solid limegreen;
  }
}

@layer module {
  .alert {
    border: medium solid violet;
    background-color: yellow;
    color: white;
  }
}

Syntax

@layer <layer-name>? { <rule-list> } | @layer <layer-name>#;

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 @layer
Chrome 99
Edge 99
Firefox 97
Safari 15.4
Chrome Android 99
Safari iOS 15.4

First version with support, from MDN browser-compat-data.

@scope

At-rule Baseline: newly availablesince March 2026 Modern CSS: @scope

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 @scope CSS at-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 preview Example 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;
  }
}

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.