Skip to content

Commit

Permalink
fix(css): define terms in layer-cascade diagram (#36656)
Browse files Browse the repository at this point in the history
* fix(css): define terms in layer-cascade diagram

* Update files/en-us/web/css/@layer/index.md

Co-authored-by: Estelle Weyl <[email protected]>

* Update files/en-us/web/css/@layer/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update files/en-us/web/css/@layer/index.md

Co-authored-by: Estelle Weyl <[email protected]>

* Update files/en-us/web/css/@layer/index.md

---------

Co-authored-by: Estelle Weyl <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 12, 2024
1 parent 8fbec53 commit 54c533b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions files/en-us/web/css/@layer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ The following diagram shows layer priorities where layers are declared in 1, 2,

![Diagram showing cascade layer priorities](https://mdn.github.io/shared-assets/images/diagrams/css/at-rules/layer-cascade.svg)

As noted in the above diagram, _important declarations_, declarations with the `!important` flag, have priority over _normal declarations_, or regular declarations without the `!important` flag. The order of precedence among important rules is the inverse of normal rules. Transitions have the greatest precedence. Next in order of highest to lowest priority are the important {{glossary("user agent")}} declarations, important user declarations, and important author declarations; in that order. Users can specify styles using browser preferences, operating system preferences, or browser extensions. Their important declarations take precedence over _author_, or _web developer_ written, important declarations.

Within author styles, all important declarations within CSS layers take precedence over any important declarations declared outside of a layer, while all normal declarations within CSS layers have a lower priority than declarations declared outside of a layer.
The declaration order matters. The first declared layer gets the lowest priority and the last declared layer gets the highest priority. However, the priority is reversed when the [`!important`](/en-US/docs/Web/CSS/important) flag is used.

The `@layer` at-rule is used to create a cascade layer in one of three ways.
Expand Down

0 comments on commit 54c533b

Please sign in to comment.