Skip to content

Commit d228964

Browse files
committed
[css-mixins-1] Review by elika
1 parent 0b9c221 commit d228964

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

css-mixins-1/Overview.bs

+17-9
Original file line numberDiff line numberDiff line change
@@ -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=],
184184
a <dfn for="custom function">function body</dfn>,
185185
and 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>>);
188188
optionally a <dfn>parameter type</dfn>, described by a [=syntax definition=];
189189
and 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">&lt;type()></dfn> = type( <<syntax>> )
201201
</pre>
202202

203+
<h4 id=function-preamble>
204+
The Function Preamble</h4>
205+
203206
The <<function-token>> production
204207
must start with two dashes (U+002D HYPHEN-MINUS),
205208
similar 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=].
236240
If more than one ''@function'' exists for a given name,
237241
then the rule in the stronger cascade layer wins,
238242
and rules defined later win within the same layer.
239243

240-
The name of a ''@function'' rule is a [=tree-scoped name=].
241-
242244
If the <<function-parameter-list>>
243245
contains the same <<custom-property-name>> more than once,
244246
then the ''@function'' rule is invalid.
245247

248+
<h4 id=function-body>
249+
The Function Body</h4>
250+
246251
The body of a ''@function'' rule accepts [=conditional group rules=],
247252
such as ''@media''.
248253
Additionally, 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

268276
The '@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.
271279
Using ''var()'' functions,
272280
it can reference [=function parameters=], [=local variables=],
273281
as well as other [=custom functions=] via <<dashed-function>>s.
274282

275283
The '@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
277285
during the [=substitute a dashed function|substitution=] of a <<dashed-function>>.
278286

279287
Arguments & Local Variables {#args}
@@ -294,11 +302,11 @@ In that list, earlier things "win" over later things of the same name--
294302
if you have a [=local variable=] named '--foo',
295303
''var(--foo)'' will be substituted by that [=local variable=],
296304
not 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:
298306
setting the '--foo' local variable to ''initial''
299307
will resolve it to the '--foo' parameter,
300308
while ''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

Comments
 (0)