Loading tutorials
@scope rule and what the browser does with it. It assumes you know HTML structure and the DOM tree, CSS selectors and combinators, the cascade (specificity and order of appearance), and the basics of CSS nesting. It does not cover scope limits, :scope in d7 min read@scope rule from the previous chapter. Here you will learn what a scope root is, which selectors make good roots, and how the root decides where your rules apply.6 min read@scope (root) { ... } rule and know what a scope root is. It also assumes you know the cascade basics: specificity, then order of appearance. Here you will learn how the :scope pseudo-class lets a scoped rule target the scope root itself, which a plain selec6 min read@scope (.root) { ... } rule and used :scope to style the root. Scope proximity and nesting come in later chapters,6 min read@scope limits where a rule applies. This chapter covers a side effect that surprises many peop7 min read@scope rules that match the same element with equal specificity. It assumes you know CSS selectors, the cascade (origin, specificity, order of appearance), and the basics of @scope from earlier chapters: scope roots, :scope, and scope lim6 min read@scope written without a prelude, the parenthesized selector after @scope, inside a <style> element. I assume you can already write an @scope (.card) rule with a scope root and use :scope to style that root. You should also know the cascade basics (specificity, then sco6 min read@scope limits where a rule applies. CSS nesting lets you write a rule inside another rule. The two features work together, but & means different things at different depths, and that trips people up. This chapter covers how nested rules resolve inside @scope, what & refers to at each level, a6 min read@scope rule with a root and a limit. It compares @scope with three other ways to keep component styles from colliding: the BEM naming convention, CSS Modules, and Shadow D7 min read@scope limits which elements a rule can match. It does not wall off a region of the page. Developers who expect a wall write CSS that leaks or is overridden in surprising ways. This chapter covers where the boundary stops and how to design around it.6 min read@scope to real users. It explains what happens in a browser that doesn't understand the rule, how to detect support, and how to write CSS that works either way.7 min read