Skip to content

Commit 45fc958

Browse files
committed
[css-mixins-1][css-values-5] Move the definition of <syntax> to V&U 5, since we'll be using it in multiple places.
1 parent fdd5d08 commit 45fc958

File tree

1 file changed

+1
-88
lines changed

1 file changed

+1
-88
lines changed

css-mixins-1/Overview.bs

Lines changed: 1 addition & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -585,91 +585,4 @@ Issue: Should we indeed use {{CSSNestedDeclarations}} for this purpose?
585585
should probably not be a regular {{CSSStyleDeclaration}},
586586
since only custom properties
587587
and the '@function/result' descriptor
588-
are relevant.
589-
590-
<!-- Big Text: appendix
591-
592-
███▌ ████▌ ████▌ █████▌ █ █▌ ████▌ ████ █ █
593-
▐█ ▐█ █▌ █▌ █▌ █▌ █▌ █▌ █▌ █▌ █▌ ▐▌ █ █
594-
█▌ █▌ █▌ █▌ █▌ █▌ █▌ ██▌ █▌ █▌ █▌ ▐▌ █ █
595-
█▌ █▌ ████▌ ████▌ ████ █▌▐█ █▌ █▌ █▌ ▐▌ █
596-
█████▌ █▌ █▌ █▌ █▌ ██▌ █▌ █▌ ▐▌ █ █
597-
█▌ █▌ █▌ █▌ █▌ █▌ █▌ █▌ █▌ ▐▌ █ █
598-
█▌ █▌ █▌ █▌ █████▌ █▌ ▐▌ ████▌ ████ █ █
599-
-->
600-
601-
Appendix: The <<syntax>> Production {#syntax}
602-
=============================================
603-
604-
The <<syntax>> production represents a [=syntax definition=],
605-
which may be used to impose a type
606-
on [=function parameters=],
607-
[=function dependencies=],
608-
or [=custom function=] return values.
609-
610-
<pre class="prod def" nohighlight>
611-
<dfn><<syntax-type>></dfn> = angle | color | custom-ident | image | integer |
612-
length | length-percentage | number |
613-
percentage | resolution | string | time |
614-
url | transform-function
615-
<dfn><<syntax-combinator>></dfn> = '|'
616-
<dfn><<syntax-multiplier>></dfn> = [ '#' | '+' ]
617-
<dfn><<syntax-component-name>></dfn> = '<' <<syntax-type>> '>' | <<custom-ident>>
618-
<dfn><<syntax-component>></dfn> = <<syntax-component-name>> <<syntax-multiplier>>? |
619-
'<' transform-list '>'
620-
<dfn><<syntax>></dfn> = '*' | <<syntax-component>> [ <<syntax-combinator>> <<syntax-component>> ]+
621-
</pre>
622-
623-
A <<syntax-component>> consists of either a <<syntax-type>>,
624-
which maps to one of the [=supported syntax component names=];
625-
or a <<custom-ident>>, which represents any [=keyword=].
626-
Additionally,
627-
a <<syntax-component>> may contain a [[css-properties-values-api-1#multipliers|multiplier]],
628-
which indicates a [=list=] of values.
629-
630-
Note: This means that <code>&lt;length&gt;</code>
631-
and <code>length</code> are two different types:
632-
the former describes a <<length>>,
633-
whereas the latter describes a [=keyword=] <code>length</code>.
634-
635-
Multiple <<syntax-component>>s may be [[css-properties-values-api-1#combinator|combined]]
636-
with a <code>|</code> <<delim-token>>,
637-
causing the syntax components to be matched
638-
against a value
639-
in the specified order.
640-
641-
<div class='example'>
642-
<xmp class='lang-css'>
643-
<percentage> | <number> | auto
644-
</xmp>
645-
646-
The above, when parsed as a <<syntax>>,
647-
would accept <<percentage>> values,
648-
<<number>> values,
649-
as well as the keyword <code>auto</code>.
650-
</div>
651-
652-
<div class='example'>
653-
<xmp class='lang-css'>
654-
red | <color>
655-
</xmp>
656-
657-
The [=syntax definition=] resulting from the above <<syntax>>,
658-
when used as a grammar for [=parse|parsing=],
659-
would match an input <code>red</code> as an [=identifier=],
660-
but would match an input <code>blue</code> as a <<color>>.
661-
</div>
662-
663-
The <code>*</code> <<delim-token>> represents the [=universal syntax definition=].
664-
665-
The <code>&lt;transform-list&gt;</code> production
666-
is a convenience form equivalent to <code>&lt;transform-function&gt;+</code>.
667-
<span class=note>Note that <code>&lt;transform-list&gt;</code> may not
668-
be followed by a <<syntax-multiplier>>.</span>
669-
670-
[=Whitespace=] is not allowed
671-
between the angle bracket <<delim-token>>s (<code>&lt;</code> <code>&gt;</code>)
672-
and the <<syntax-type>> they enclose,
673-
nor is [=whitespace=] allowed to precede a <<syntax-multiplier>>.
674-
675-
Note: The [=whitespace=] restrictions also apply to <code>&lt;transform-list&gt;</code>.
588+
are relevant.

0 commit comments

Comments
 (0)