@@ -116,7 +116,7 @@ Introduction {#intro}
116116
117117 .foo {
118118 --shadow-color: blue;
119- box-shadow: --shadow(); // produces a blue shadow
119+ box-shadow: --shadow(); /* produces a blue shadow */
120120 /* or just */
121121 box-shadow: --shadow(blue);
122122 }
@@ -184,7 +184,7 @@ a list of [=function parameter|parameters=],
184184a <dfn for="custom function">function body</dfn> ,
185185and optionally a <dfn for="custom function">return type</dfn> described by a [=syntax definition=] .
186186
187- A <dfn>function parameter</dfn> consists of a name (<<custom-property-name>> );
187+ Each <dfn>function parameter</dfn> consists of a name (<<custom-property-name>> );
188188optionally a <dfn>parameter type</dfn> , described by a [=syntax definition=] ;
189189and optionally a <dfn>default value</dfn> .
190190
@@ -200,6 +200,9 @@ and optionally a <dfn>default value</dfn>.
200200<dfn function lt="type()" for="@function"><type()></dfn> = type( <<syntax>> )
201201</pre>
202202
203+ <h4 id=function-preamble>
204+ The Function Preamble</h4>
205+
203206The <<function-token>> production
204207must start with two dashes (U+002D HYPHEN-MINUS),
205208similar to <<dashed-ident>> ,
@@ -233,22 +236,27 @@ and the optional [=custom function/return type=] is given by the <<css-type>> fo
233236</div>
234237
235238
239+ The name of a ''@function'' rule is a [=tree-scoped name=] .
236240If more than one ''@function'' exists for a given name,
237241then the rule in the stronger cascade layer wins,
238242and rules defined later win within the same layer.
239243
240- The name of a ''@function'' rule is a [=tree-scoped name=] .
241-
242244If the <<function-parameter-list>>
243245contains the same <<custom-property-name>> more than once,
244246then the ''@function'' rule is invalid.
245247
248+ <h4 id=function-body>
249+ The Function Body</h4>
250+
246251The body of a ''@function'' rule accepts [=conditional group rules=] ,
247252such as ''@media'' .
248253Additionally, it accepts the following descriptors:
249254
250255 * The '@function/result' descriptor,
251256 which determines the result of [=evaluating a custom function|evaluating the function=] .
257+ If no '@function/result' descriptor exists,
258+ the function is valid,
259+ but always returns the [=guaranteed-invalid value=] .
252260 * [=Custom properties=] ,
253261 providing <dfn>local variables</dfn> .
254262
@@ -266,14 +274,14 @@ Initial: n/a (see prose)
266274</pre>
267275
268276The '@function/result' descriptor
269- determines the result of [=evaluate a custom function|evaluating=]
270- the [=custom function=] that is defined by a ''@function'' rule.
277+ defines the result of [=evaluate a custom function|evaluating=]
278+ the [=custom function=] defined by its ''@function'' rule.
271279Using ''var()'' functions,
272280it can reference [=function parameters=] , [=local variables=] ,
273281as well as other [=custom functions=] via <<dashed-function>> s.
274282
275283The '@function/result' descriptor itself does not have a type,
276- but its [=resolve function styles|resolved=] value is type checked
284+ but its [=resolve function styles|resolved=] value is type- checked
277285during the [=substitute a dashed function|substitution=] of a <<dashed-function>> .
278286
279287Arguments & Local Variables {#args}
@@ -294,11 +302,11 @@ In that list, earlier things "win" over later things of the same name--
294302if you have a [=local variable=] named '--foo' ,
295303''var(--foo)'' will be substituted by that [=local variable=] ,
296304not by an argument or a custom property defined outside.
297- ( The other values can still be <em> accessed</em> , however:
305+ The other values can still be <em> accessed</em> , however:
298306setting the '--foo' local variable to ''initial''
299307will resolve it to the '--foo' parameter,
300308while ''inherit'' will resolve it
301- to the '--foo' custom property from the call site.)
309+ to the '--foo' custom property from the call site.
302310
303311<div class='example'>
304312 A [=custom function=] can access [=local variables=]
0 commit comments