1- # Attr Type: Draft 1.1
1+ # Attr Type: Draft 2.0
22
33* ([ Issue] ( https://github.com/sass/sass/issues/4030 ) ,
44[ Changelog] ( attr-type.changes.md ) )*
77
88* [ Background] ( #background )
99* [ Summary] ( #summary )
10+ * [ Definitions] ( #definitions )
11+ * [ Special Number] ( #special-number )
1012* [ Syntax] ( #syntax )
1113 * [ ` SpecialFunctionExpression ` ] ( #specialfunctionexpression )
1214 * [ ` SingleExpression ` ] ( #singleexpression )
@@ -62,6 +64,15 @@ anticipate that a single `%` will be widely used in other contexts, so we don't
6264plan to deprecate the modulo operator, although that path is open in the future
6365if CSS starts using this value more widely.
6466
67+ ## Definitions
68+
69+ ### Special Number
70+
71+ Add ` attr( ` to the list of unquoted string prefixes that qualify as [ special
72+ numbers] .
73+
74+ [ special numbers ] : ../spec/functions.md#special-number
75+
6576## Syntax
6677
6778### ` SpecialFunctionExpression `
@@ -82,15 +93,28 @@ Change [the `SpecialFunctionName` production] to be:
8293
8394### ` SingleExpression `
8495
85- Add ` Percent ` as a production to [ ` SingleExpression ` ] with the annotation "If
86- this is ambiguous with part of ` ProductExpression ` , parse ` ProductExpression `
87- preferentially".
96+ Add ` Percent ` as a production to [ ` SingleExpression ` ] with the following
97+ annotation:
8898
8999[ `SingleExpression` ] : ../spec/syntax.md#singleexpression
90100
101+ If this is ambiguous with part of ` ProductExpression ` , parse ` ProductExpression `
102+ preferentially. If this is followed by a [ ` Whitespace ` ] that contains a
103+ [ ` LineBreak ` ] , do not parse that ` Whitespace ` as part of an [ ` IndentSame ` ] or
104+ [ ` IndentMore ` ] production.
105+
106+ [ `Whitespace` ] : ../spec/statement.md#whitespace
107+ [ `LineBreak` ] : ../spec/statement.md#whitespace
108+ [ `IndentSame` ] : ../spec/statement.md#indentation
109+ [ `IndentMore` ] : ../spec/statement.md#indentation
110+
91111> This effectively means that the unquoted string ` % ` is allowed everywhere
92112> * except* in a middle element of a space-separated list, since that would be
93- > ambiguous with a modulo operation.
113+ > ambiguous with a modulo operation. The whitespace clause ensures that a ` % ` at
114+ > the end of a line in the indented syntax always looks at the next token, for
115+ > backwards-compatibility with parsing it as an operator and so that whether the
116+ > statement ends on that line or not doesn't depend on the first token of the
117+ > next line.
94118
95119### ` Percent `
96120
@@ -110,7 +134,7 @@ In the [semantics for `@function`], add a bullet point below the second:
110134
111135[ semantics for `@function` ] : ../spec/at-rules/function.md#semantics
112136
113- * If ` name ` is ` type ` , throw an error.
137+ * If ` name ` is case-insensitively equal to ` type ` , throw an error.
114138
115139> Unlike other forbidden function names, this doesn't cover vendor prefixes.
116140> This is for two reasons: first, we don't expect to add special parsing for
0 commit comments