← 返回首页
The leading <declaration-value> in <if-args-branch> excludes ":" · cdoublev/css@d690250 · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Commit d690250

Browse files
committed
The leading <declaration-value> in <if-args-branch> excludes ":"
w3c/csswg-drafts#12487
1 parent ff2ca71 commit d690250

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎lib/parse/arbitrary.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ function matchFreeFormValue(node, match) {
137137
}
138138
return error(node)
139139
}
140+
if (isProducedBy(node, '<if-args-branch>')) {
141+
return match(node, [',', '{', ':'])
142+
}
140143
return match(node, [',', '{'])
141144
}
142145
return match(node)

‎lib/values/definitions.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export default {
245245
'<ident-arg>': '<string> | <integer> | <ident>',
246246
'<ident>': '<ident-token>',
247247
'<if()>': 'if([<if-branch> ;]* <if-branch> ;?)',
248-
'<if-args-branch>': '<declaration-value> [: <declaration-value>?]?',
248+
'<if-args-branch>': '<declaration-value> : <declaration-value>?',
249249
'<if-args>': 'if([<if-args-branch> ;]* <if-args-branch> ;?)',
250250
'<if-branch>': '<if-condition> : <declaration-value>?',
251251
'<if-condition>': '<boolean-expr[<if-test> ]> | else',

‎scripts/extract.js‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,6 @@ const replaced = {
201201
'<feature-index>': '<integer>',
202202
// https://github.com/w3c/csswg-drafts/issues/13010
203203
'<event-trigger-event>': 'activate | click | touch | dblclick | keypress(<string>)',
204-
// https://github.com/w3c/csswg-drafts/issues/12487
205-
'<if-args-branch>': '<declaration-value> [: <declaration-value>?]?',
206204
// https://github.com/w3c/fxtf-drafts/issues/532
207205
'<mask-reference>': 'none | <image>',
208206
// TODO: fix `value` of `<pseudo-page>`

‎test/style.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ describe('arbitrary substitution', () => {
656656
['--custom(--custom(!))'],
657657
['attr(name, attr())'],
658658
['env(name, env())'],
659-
['if(if())', 'if(if())'],
659+
['if(if():)'],
660660
['inherit(--custom, inherit())'],
661661
['random-item(--key, random-item())'],
662662
['var(--custom, var())'],

0 commit comments

Comments
 (0)

Footer

© 2026 GitHub, Inc.