Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions css-mixins-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Defining Custom Functions {#defining-custom-functions}
<div class='example'>
A simple [=custom function=] to negate a value can be defined as follows:
<pre class='lang-css'>
@function --negative (--value) {
@function --negative(--value) {
result: calc(-1 * var(--value));
}
</pre>
Expand Down Expand Up @@ -101,21 +101,25 @@ The ''@function'' rule defines a [=custom function=],
and its syntax is:

<pre class="prod def" nohighlight>
&lt;@function> = @function <<function-name>> [ ( <<function-parameter-list>> ) ]?
&lt;@function> = @function <<function-name>> <<function-parameter-list>>? )
[ using ( <<function-dependency-list>> ) ]?
[ returns <<css-type>> ]?
{
<<declaration-rule-list>>
}

<dfn><<function-name>></dfn> = <<dashed-ident>>
<dfn><<function-parameter-list>></dfn> = <<function-parameter>>#
<dfn><<function-dependency-list>></dfn> = <<function-parameter>>#
<dfn><<function-parameter>></dfn> = <<custom-property-name>> <<css-type>>? [ : <<declaration-value>> ]?
<dfn><<css-type>></dfn> = <<syntax-component>> | <<type()>>
<dfn>&lt;type()></dfn> = type( <<syntax>> )
</pre>

The <dfn><<function-name>></dfn> production
is a <<function-token>>,
with the additional restriction that it must start with two dashes
(U+002D HYPHEN-MINUS).

The name of the resulting [=custom function=] is given by the <<function-name>>,
the [=function parameters=] are optionally given by <<function-parameter-list>>,
the [=function dependencies=] are optionally given by <<function-dependency-list>>,
Expand Down