[go: nahoru, domu]

Skip to content

Commit

Permalink
[css-cascade-6] Remove scope-prelude from specificity calculation #8500
Browse files Browse the repository at this point in the history
  • Loading branch information
mirisuzanne committed Mar 2, 2023
1 parent 37129a9 commit b3f5761
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions css-cascade-6/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -397,28 +397,28 @@ Scoping Styles: the ''@scope'' rule</h4>
* Selectors can only match elements that are [=in scope=].
This only applies to the [=subject=];
the rest of the selector can match unrestricted.
* Selectors are given the added specificity of
the most specific [=complex selector=] in the <<scope-start>> argument.

Note: This is designed to match the behavior of the '':is()'' selector.

* The [=cascade=] prioritizes declarations
with a [=scope proximity|more proximate=] [=scoping root=],
regardless of specificity or source order.

Note: Unlike <a href="https://www.w3.org/TR/css-nesting/">Nesting</a>,
selectors within an ''@scope'' rule
do not acquire the specificity of any parent selector(s) in the ''@scope'' prelude.

<div class=example>
The following selectors have the same specificity (1,0,1):
The following selectors have the same specificity (0,0,1):

<pre class=lang-css>
@scope (#hero) {
img { border-radius: 50%; }
}

#hero img { border-radius: 50%; }
:where(#hero) img { border-radius: 50%; }
</pre>

But because <{img}> is scoped,
it is weighted more strongly in the cascade.
But because one <{img}> selector is scoped,
that selector is weighted more strongly in the cascade.
</div>

<div class=example>
Expand Down

0 comments on commit b3f5761

Please sign in to comment.