Skip to content

Commit

Permalink
[css-syntax-3] Define at-rule and descriptor. #5633
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasai committed Jan 14, 2021
1 parent 631c44c commit 25d907c
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions css-syntax-3/Overview.bs
Expand Up @@ -3361,6 +3361,40 @@ Style rules</h3>
For example, qualified rules inside ''@media'' rules [[CSS3-CONDITIONAL]] are style rules,
but qualified rules inside ''@keyframes'' rules are not [[CSS3-ANIMATIONS]].

<h3 id="at-rules">
At-rules</h3>

An <dfn export>at-rule</dfn> is a rule that begins with an at-keyword,
and can thus be distinguished from [=style rules=] in the same context.

[=At-rules=] are used to:

* group and structure style rules and other at-rules
such as in [=conditional rules=]
* declare style information that is not associated with a particular element,
such as defining [=counter styles=]
* manage syntactic constructs
such as [=imports=] and [=namespace=] keyword mappings
* and serve other miscellaneous purposes not served by a [=style rule=]

At-rules take many forms, depending on the specific rule and its purpose,
but broadly speaking there are two kinds:
<dfn lt="statement at-rule" export>statement at-rules</dfn>
which are simpler constructs that end in a semicolon,
and <dfn lt="block at-rule" export>block at-rules</dfn>
which end in a [={}-block=]
that can contain nested [=rules=] or [=declarations=].

[=Block at-rules=] will typically contain a collection of
(generic or [=at-rule=]&ndash;specific)
[=at-rules=], [=qualified rules=], and/or [=descriptor declarations=]
subject to limitations defined by the [=at-rule=].
<dfn lt="descriptor" export for=CSS>Descriptors</dfn> are similar to [=properties=]
(and are declared with the same syntax)
but are associated with a particular type of [=at-rule=]
rather than with elements and boxes in the tree.


<h3 id='charset-rule'>
The ''@charset'' Rule</h3>

Expand Down

0 comments on commit 25d907c

Please sign in to comment.