Skip to content

Commit fe94b66

Browse files
andruudAnders Hartvoll Ruud
andauthored
[css-mixins-1] Do not allow whitespace before parameter list (#11502)
This also makes the parameter list required. A discussion could be had about 'using' as well, but since it looks like we're going to remove it, that problem will probably disappear on its own. Co-authored-by: Anders Hartvoll Ruud <andruud@google.com>
1 parent 14ae4f6 commit fe94b66

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

css-mixins-1/Overview.bs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Defining Custom Functions {#defining-custom-functions}
6767
<div class='example'>
6868
A simple [=custom function=] to negate a value can be defined as follows:
6969
<pre class='lang-css'>
70-
@function --negative (--value) {
70+
@function --negative(--value) {
7171
result: calc(-1 * var(--value));
7272
}
7373
</pre>
@@ -101,21 +101,25 @@ The ''@function'' rule defines a [=custom function=],
101101
and its syntax is:
102102

103103
<pre class="prod def" nohighlight>
104-
&lt;@function> = @function <<function-name>> [ ( <<function-parameter-list>> ) ]?
104+
&lt;@function> = @function <<function-name>> <<function-parameter-list>>? )
105105
[ using ( <<function-dependency-list>> ) ]?
106106
[ returns <<css-type>> ]?
107107
{
108108
<<declaration-rule-list>>
109109
}
110110
111-
<dfn><<function-name>></dfn> = <<dashed-ident>>
112111
<dfn><<function-parameter-list>></dfn> = <<function-parameter>>#
113112
<dfn><<function-dependency-list>></dfn> = <<function-parameter>>#
114113
<dfn><<function-parameter>></dfn> = <<custom-property-name>> <<css-type>>? [ : <<declaration-value>> ]?
115114
<dfn><<css-type>></dfn> = <<syntax-component>> | <<type()>>
116115
<dfn>&lt;type()></dfn> = type( <<syntax>> )
117116
</pre>
118117

118+
The <dfn><<function-name>></dfn> production
119+
is a <<function-token>>,
120+
with the additional restriction that it must start with two dashes
121+
(U+002D HYPHEN-MINUS).
122+
119123
The name of the resulting [=custom function=] is given by the <<function-name>>,
120124
the [=function parameters=] are optionally given by <<function-parameter-list>>,
121125
the [=function dependencies=] are optionally given by <<function-dependency-list>>,

0 commit comments

Comments
 (0)