Skip to content

Commit

Permalink
[css-mixins-1] Remove mentions of @nest (#10501)
Browse files Browse the repository at this point in the history
  • Loading branch information
andruud committed Jun 26, 2024
1 parent e4ba280 commit 5d578a9
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions css-mixins-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ contains the same <<custom-property-name>> more than once,
then the ''@function'' rule is invalid.

The body of a ''@function'' rule accepts [=conditional group rules=],
such as ''@media'', as well as the ''@nest'' rule.
such as ''@media''.
Additionally, it accepts the following descriptors:

* The '@function/result' descriptor,
Expand Down Expand Up @@ -498,18 +498,6 @@ or acting as if nothing exists at that location otherwise.
</pre>
</div>


Interaction with @nest {#at-nest}
----------------------------

''@nest'' rules are valid within ''@function'',
with the additional restriction
that only descriptors allowed within ''@function''
are allowed within the ''@nest'' rule.

A ''@nest'' rule within ''@function'' does nothing:
it acts like its contents were present at its location.

<!-- Big Text: cssom

███▌ ███▌ ███▌ ███▌ █ █
Expand All @@ -534,7 +522,7 @@ interface CSSFunctionRule : CSSGroupingRule { };
While declarations may be specified directly within a ''@function'' rule,
they are not represented as such in the CSSOM.
Instead, consecutive segments of declarations
appear as if wrapped in ''@nest'' rules.
appear as if wrapped in {{CSSNestedDeclarations}} rules.

Note: This also applies to the "leading" declarations in the ''@function'' rule,
i.e those that do not follow another nested rule.
Expand All @@ -555,22 +543,22 @@ Note: This also applies to the "leading" declarations in the ''@function'' rule,

<pre class='lang-css'>
@function --bar() {
@nest {
/* CSSNestedDeclarations { */
--x: 42;
result: var(--y);
}
/* } */
@media (width > 1000px) {
/* ... */
}
@nest {
/* CSSNestedDeclarations { */
--y: var(--x);
}
/* } */
}
</pre>
</div>

Issue: Should we indeed use ''@nest'' for this purpose?
The <code>style</code> attribute of the ''@nest'' rule
Issue: Should we indeed use {{CSSNestedDeclarations}} for this purpose?
The <code>style</code> attribute of the {{CSSNestedDeclarations}} rule
should probably not be a regular {{CSSStyleDeclaration}},
since only custom properties
and the '@function/result' descriptor
Expand Down

0 comments on commit 5d578a9

Please sign in to comment.