Skip to content

Commit 81992ac

Browse files
committed
Upgrade dependencies
1 parent 3ddc303 commit 81992ac

File tree

8 files changed

+110
-83
lines changed

8 files changed

+110
-83
lines changed

__tests__/value.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2926,7 +2926,7 @@ describe('<basic-shape>', () => {
29262926
['polygon(1px 1px)', {
29272927
name: 'polygon',
29282928
types: ['<function>', '<polygon()>', '<basic-shape>'],
2929-
value: list([omitted, omitted, list([list([px, px])], ',')]),
2929+
value: list([omitted, omitted, omitted, list([list([px, px])], ',')]),
29302930
}],
29312931
['rect(1px 1px 1px 1px)', {
29322932
name: 'rect',

lib/descriptors/definitions.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,18 @@ module.exports = {
4545
type: 'discrete',
4646
value: 'portrait | landscape',
4747
},
48+
'overflowing': {
49+
type: 'discrete',
50+
value: 'top | right | bottom | left | block-start | inline-start | block-end | inline-end',
51+
},
52+
'snapped': {
53+
type: 'discrete',
54+
value: 'x | y | block | inline',
55+
},
56+
'stuck': {
57+
type: 'discrete',
58+
value: 'top | right | bottom | left | block-start | inline-start | block-end | inline-end',
59+
},
4860
'width': {
4961
type: 'range',
5062
value: '<length>',

lib/properties/definitions.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,7 +1695,7 @@ module.exports = {
16951695
},
16961696
serialized: 'auto',
16971697
},
1698-
value: 'auto | <length-percentage>',
1698+
value: 'auto | <length-percentage> | <anchor()> | <anchor-size()>',
16991699
},
17001700
'box-decoration-break': {
17011701
initial: {
@@ -2236,7 +2236,7 @@ module.exports = {
22362236
},
22372237
serialized: 'normal',
22382238
},
2239-
value: 'normal | size | inline-size',
2239+
value: 'normal | [size | inline-size] || scroll-state',
22402240
},
22412241
'content': {
22422242
initial: {
@@ -2703,7 +2703,7 @@ module.exports = {
27032703
value: 'none | <custom-ident> [element | content]?',
27042704
},
27052705
'font': {
2706-
value: "[<'font-style'> || <font-variant-css2> || <'font-weight'> || <font-width-css3>]? <'font-size'> [/ <'line-height'>]? <'font-family'> | <system-family-name>",
2706+
value: "[<'font-style'> || <font-variant-css2> || <'font-weight'> || <font-width-css3>]? <'font-size'> [/ <'line-height'>]? <'font-family'># | <system-family-name>",
27072707
},
27082708
'font-family': {
27092709
initial: {
@@ -3177,7 +3177,7 @@ module.exports = {
31773177
},
31783178
serialized: 'none',
31793179
},
3180-
value: 'none | <track-list> | <auto-track-list> | subgrid <line-name-list>? | masonry',
3180+
value: 'none | <track-list> | <auto-track-list> | subgrid <line-name-list>?',
31813181
},
31823182
'grid-template-rows': {
31833183
initial: {
@@ -3189,7 +3189,7 @@ module.exports = {
31893189
},
31903190
serialized: 'none',
31913191
},
3192-
value: 'none | <track-list> | <auto-track-list> | subgrid <line-name-list>? | masonry',
3192+
value: 'none | <track-list> | <auto-track-list> | subgrid <line-name-list>?',
31933193
},
31943194
'hanging-punctuation': {
31953195
initial: {
@@ -3214,7 +3214,7 @@ module.exports = {
32143214
},
32153215
serialized: 'auto',
32163216
},
3217-
value: 'auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain',
3217+
value: 'auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()> | stretch | fit-content | contain',
32183218
},
32193219
'hyphenate-character': {
32203220
initial: {
@@ -3555,7 +3555,7 @@ module.exports = {
35553555
},
35563556
serialized: 'auto',
35573557
},
3558-
value: 'auto | <length-percentage>',
3558+
value: 'auto | <length-percentage> | <anchor()> | <anchor-size()>',
35593559
},
35603560
'letter-spacing': {
35613561
initial: {
@@ -3757,7 +3757,7 @@ module.exports = {
37573757
},
37583758
serialized: '0px',
37593759
},
3760-
value: '<length-percentage> | auto',
3760+
value: '<length-percentage> | auto | <anchor-size()>',
37613761
},
37623762
'margin-break': {
37633763
initial: {
@@ -3808,7 +3808,7 @@ module.exports = {
38083808
},
38093809
serialized: '0px',
38103810
},
3811-
value: '<length-percentage> | auto',
3811+
value: '<length-percentage> | auto | <anchor-size()>',
38123812
},
38133813
'margin-right': {
38143814
group: 'margin',
@@ -3820,7 +3820,7 @@ module.exports = {
38203820
},
38213821
serialized: '0px',
38223822
},
3823-
value: '<length-percentage> | auto',
3823+
value: '<length-percentage> | auto | <anchor-size()>',
38243824
},
38253825
'margin-top': {
38263826
group: 'margin',
@@ -3832,7 +3832,7 @@ module.exports = {
38323832
},
38333833
serialized: '0px',
38343834
},
3835-
value: '<length-percentage> | auto',
3835+
value: '<length-percentage> | auto | <anchor-size()>',
38363836
},
38373837
'margin-trim': {
38383838
initial: {
@@ -4249,7 +4249,7 @@ module.exports = {
42494249
},
42504250
serialized: 'none',
42514251
},
4252-
value: 'none | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain',
4252+
value: 'none | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()> | stretch | fit-content | contain',
42534253
},
42544254
'max-inline-size': {
42554255
group: 'max-size',
@@ -4287,7 +4287,7 @@ module.exports = {
42874287
},
42884288
serialized: 'none',
42894289
},
4290-
value: 'none | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain',
4290+
value: 'none | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()> | stretch | fit-content | contain',
42914291
},
42924292
'min-block-size': {
42934293
group: 'min-size',
@@ -4312,7 +4312,7 @@ module.exports = {
43124312
},
43134313
serialized: 'auto',
43144314
},
4315-
value: 'auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain',
4315+
value: 'auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()> | stretch | fit-content | contain',
43164316
},
43174317
'min-inline-size': {
43184318
group: 'min-size',
@@ -4349,7 +4349,7 @@ module.exports = {
43494349
},
43504350
serialized: 'auto',
43514351
},
4352-
value: 'auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain',
4352+
value: 'auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()> | stretch | fit-content | contain',
43534353
},
43544354
'mix-blend-mode': {
43554355
initial: {
@@ -5356,7 +5356,7 @@ module.exports = {
53565356
},
53575357
serialized: 'auto',
53585358
},
5359-
value: 'auto | <length-percentage>',
5359+
value: 'auto | <length-percentage> | <anchor()> | <anchor-size()>',
53605360
},
53615361
'rotate': {
53625362
initial: {
@@ -6665,7 +6665,7 @@ module.exports = {
66656665
},
66666666
serialized: 'auto',
66676667
},
6668-
value: 'auto | <length-percentage>',
6668+
value: 'auto | <length-percentage> | <anchor()> | <anchor-size()>',
66696669
},
66706670
'touch-action': {
66716671
animate: false,
@@ -7195,7 +7195,7 @@ module.exports = {
71957195
},
71967196
serialized: 'auto',
71977197
},
7198-
value: 'auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | stretch | fit-content | contain',
7198+
value: 'auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()> | stretch | fit-content | contain',
71997199
},
72007200
'will-change': {
72017201
animate: false,

lib/serialize.js

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,18 +1012,36 @@ function serializeNumber({ value }) {
10121012
}
10131013

10141014
/**
1015-
* @param {object} shape
1015+
* @param {object} path
10161016
* @returns {string}
10171017
* @see {@link https://drafts.csswg.org/css-shapes-1/#funcdef-basic-shape-path}
1018-
* @see {@link https://drafts.csswg.org/css-shapes-1/#funcdef-basic-shape-polygon}
10191018
*/
1020-
function serializePath({ name, value }) {
1019+
function serializePath({ value }) {
10211020
const [fillRule,, ...args] = value.map(serializeCSSComponentValue)
1022-
let string = `${name}(`
10231021
if (fillRule && fillRule !== 'nonzero') {
1024-
string += `${fillRule}, `
1022+
return `path(${fillRule}, ${serializeCSSComponentValueList(args)})`
10251023
}
1026-
return `${string}${serializeCSSComponentValueList(args)})`
1024+
return `path(${serializeCSSComponentValueList(args)})`
1025+
}
1026+
1027+
/**
1028+
* @param {object} polygon
1029+
* @returns {string}
1030+
* @see {@link https://drafts.csswg.org/css-shapes-1/#funcdef-basic-shape-polygon}
1031+
*/
1032+
function serializePolygon({ value }) {
1033+
const [fillRule, round,, ...args] = value.map(serializeCSSComponentValue)
1034+
const options = []
1035+
if (fillRule && fillRule !== 'nonzero') {
1036+
options.push(fillRule)
1037+
}
1038+
if (round) {
1039+
options.push(round)
1040+
}
1041+
if (0 < options.length) {
1042+
return `polygon(${options.join(' ')}, ${serializeCSSComponentValueList(args)})`
1043+
}
1044+
return `polygon(${serializeCSSComponentValueList(args)})`
10271045
}
10281046

10291047
/**
@@ -1488,8 +1506,9 @@ function serializeCSSComponentValue(component) {
14881506
case '<number-token>':
14891507
return serializeNumber(component)
14901508
case '<path()>':
1491-
case '<polygon()>':
14921509
return serializePath(component)
1510+
case '<polygon()>':
1511+
return serializePolygon(component)
14931512
case '<radial-gradient-syntax>':
14941513
return serializeRadialGradientSyntax(component)
14951514
case '<radial-size>':

lib/values/definitions.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ module.exports = {
147147
'<display-listitem>': '<display-outside>? && [flow | flow-root]? && list-item',
148148
'<display-outside>': 'block | inline | run-in',
149149
'<drop-shadow()>': 'drop-shadow(<color>? && <length>{2,3})',
150-
'<easing-function>': 'linear | <linear-easing-function> | <cubic-bezier-easing-function> | <step-easing-function>',
150+
'<easing-function>': '<linear-easing-function> | <cubic-bezier-easing-function> | <step-easing-function>',
151151
'<east-asian-variant-values>': 'jis78 | jis83 | jis90 | jis04 | simplified | traditional',
152152
'<east-asian-width-values>': 'full-width | proportional-width',
153153
'<element()>': 'element(<custom-ident> , [first | start | last | first-except]?)',
@@ -244,14 +244,12 @@ module.exports = {
244244
'<line-names>': "'['<custom-ident>*']'",
245245
'<line-style>': 'none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset',
246246
'<line-width>': '<length [0,∞]> | thin | medium | thick',
247+
'<linear()>': 'linear([<number> && <percentage>{0,2}]#)',
247248
'<linear-color-hint>': '<length-percentage>',
248249
'<linear-color-stop>': '<color> <color-stop-length>?',
249-
'<linear-easing-function>': 'linear(<linear-stop-list>)',
250+
'<linear-easing-function>': 'linear | <linear()>',
250251
'<linear-gradient()>': 'linear-gradient(<linear-gradient-syntax>)',
251252
'<linear-gradient-syntax>': '[[<angle> | <zero> | to <side-or-corner>] || <color-interpolation-method>]? , <color-stop-list>',
252-
'<linear-stop-length>': '<percentage>{1,2}',
253-
'<linear-stop-list>': '<linear-stop>#',
254-
'<linear-stop>': '<number> && <linear-stop-length>?',
255253
'<link-param>': 'param(<custom-property-name> <declaration-value>?)',
256254
'<log()>': 'log(<calc-sum> , <calc-sum>?)',
257255
'<marker-ref>': '<url>',
@@ -325,7 +323,7 @@ module.exports = {
325323
'<perspective()>': 'perspective(<length [0,∞]> | none)',
326324
'<points>': '<number>+#',
327325
'<polar-color-space>': 'hsl | hwb | lch | oklch',
328-
'<polygon()>': "polygon(<'fill-rule'>? , [<length-percentage> <length-percentage>]#)",
326+
'<polygon()>': "polygon(<'fill-rule'>? [round <length>]? , [<length-percentage> <length-percentage>]#)",
329327
'<position-area>': '[left | center | right | span-left | span-right | x-start | x-end | span-x-start | span-x-end | x-self-start | x-self-end | span-x-self-start | span-x-self-end | span-all] || [top | center | bottom | span-top | span-bottom | y-start | y-end | span-y-start | span-y-end | y-self-start | y-self-end | span-y-self-start | span-y-self-end | span-all] | [block-start | center | block-end | span-block-start | span-block-end | span-all] || [inline-start | center | inline-end | span-inline-start | span-inline-end | span-all] | [self-block-start | center | self-block-end | span-self-block-start | span-self-block-end | span-all] || [self-inline-start | center | self-inline-end | span-self-inline-start | span-self-inline-end | span-all] | [start | center | end | span-start | span-end | span-all]{1,2} | [self-start | center | self-end | span-self-start | span-self-end | span-all]{1,2}',
330328
'<position>': 'left | center | right | top | bottom | <length-percentage> | [left | center | right] && [top | center | bottom] | [left | center | right | <length-percentage>] [top | center | bottom | <length-percentage>] | [left | right] <length-percentage> && [top | bottom] <length-percentage>',
331329
'<pow()>': 'pow(<calc-sum> , <calc-sum>)',
@@ -340,7 +338,7 @@ module.exports = {
340338
'<pt-class-selector>': "['.' <custom-ident>]+",
341339
'<pt-name-and-class-selector>': '<pt-name-selector> <pt-class-selector>? | <pt-class-selector>',
342340
'<pt-name-selector>': "'*' | <custom-ident>",
343-
'<query-in-parens>': '(<container-query>) | (<size-feature>) | style(<style-query>) | <general-enclosed>',
341+
'<query-in-parens>': '(<container-query>) | (<size-feature>) | style(<style-query>) | scroll-state(<scroll-state-query>) | <general-enclosed>',
344342
'<quirky-color>': '<number-token> | <ident-token> | <dimension-token>',
345343
'<quirky-length>': '<number-token>',
346344
'<quote>': 'open-quote | close-quote | no-open-quote | no-close-quote',
@@ -391,6 +389,8 @@ module.exports = {
391389
'<scope-end>': '<forgiving-selector-list>',
392390
'<scope-start>': '<forgiving-selector-list>',
393391
'<scroll()>': 'scroll([<scroller> || <axis>]?)',
392+
'<scroll-state-in-parens>': '(<scroll-state-query>) | (<scroll-state-feature>) | <general-enclosed>',
393+
'<scroll-state-query>': 'not <scroll-state-in-parens> | <scroll-state-in-parens> [[and <scroll-state-in-parens>]* | [or <scroll-state-in-parens>]*] | <scroll-state-feature>',
394394
'<scroller>': 'root | nearest | self',
395395
'<selector-list>': '<complex-selector-list>',
396396
'<self-position>': 'center | start | end | self-start | self-end | flex-start | flex-end',

0 commit comments

Comments
 (0)