Skip to content

Commit

Permalink
[css-values-5] [css-mixins-1] Define local type() functions (#11470)
Browse files Browse the repository at this point in the history
* [css-values-5] [css-mixins-1] Define local `type()` functions

* Update css-mixins-1/Overview.bs

* Update css-values-5/Overview.bs

---------

Co-authored-by: Tab Atkins Jr. <jackalmage@gmail.com>
  • Loading branch information
bramus and tabatkins authored Jan 14, 2025
1 parent 02ad75a commit f1f3672
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions css-mixins-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ and its syntax is:
<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>> )
<dfn function lt="type()" for="@function">&lt;type()></dfn> = type( <<syntax>> )
</pre>

The <dfn><<function-name>></dfn> production
Expand All @@ -131,7 +131,7 @@ and the [=return type=] is optionally given by the <<css-type>> following the "r
[=function dependency=],
or [=custom function=] return value
can be described by a single <<syntax-component>>,
then the <code>type()</code> function may be omitted:
then the ''type()'' function may be omitted:

<pre class='lang-css'>
@function --foo(--a &lt;length&gt;) { /* ... */ }
Expand All @@ -141,7 +141,7 @@ and the [=return type=] is optionally given by the <<css-type>> following the "r

However,
any <<syntax>> that requires a <<syntax-combinator>>
needs to be wrapped in the <code>type()</code> function:
needs to be wrapped in the ''type()'' function:

<pre class='lang-css'>
@function --foo(--a type(&lt;number&gt; | &lt;percentage&gt;)) { /* ... */ }
Expand Down
2 changes: 1 addition & 1 deletion css-values-5/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,7 @@ Ian's proposal:
attr() = attr( <<attr-name>> <<attr-type>>? , <<declaration-value>>?)
<dfn>&lt;attr-name></dfn> = [ <<ident-token>>? '|' ]? <<ident-token>>
<dfn>&lt;attr-type></dfn> = type( <<syntax>> ) | string | <<attr-unit>>
<dfn>&lt;attr-type></dfn> = <dfn function lt="type()" for="attr()">type( <<syntax>> )</dfn> | string | <<attr-unit>>
</pre>

The <dfn>&lt;attr-unit></dfn> production matches any [=identifier=]
Expand Down

0 comments on commit f1f3672

Please sign in to comment.