Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ testRule({
{
code: 'a { width: min-intrinsic; }',
},
{
code: 'a { view-timeline-name: --foo; }',
},
{
code: 'a { view-timeline: --bar x; }',
},
{
code: 'a { view-transition-name: qux-baz; }',
},
{
code: 'a { anchor-name: --bar, --qux; }',
},
{
code: stripIndent`
a { font-weight: bolder; }
Expand Down
18 changes: 16 additions & 2 deletions lib/rules/declaration-property-value-no-unknown/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,32 @@ const rule = (primary, secondaryOptions) => {
const propertiesSyntax = {
overflow: '| overlay', // csstree/csstree#248
width: '| min-intrinsic | -moz-min-content | -moz-available | -webkit-fill-available', // csstree/csstree#242
'anchor-name': 'none | <custom-property-name>#',
'field-sizing': 'content | fixed',
'text-box-edge':
'auto | [ text | cap | ex | ideographic | ideographic-ink ] [ text | alphabetic | ideographic | ideographic-ink ]?',
'text-box-trim': 'none | trim-start | trim-end | trim-both',
'text-spacing-trim': 'normal | space-all | space-first | trim-start',
'word-break': '| auto-phrase',
'text-wrap-mode': 'wrap | nowrap',
'text-wrap-style': 'auto | balance | pretty | stable',
'text-wrap': "<'text-wrap-mode'> || <'text-wrap-style'>",
'view-timeline-axis': '[ block | inline | x | y ]#',
'view-timeline-inset': '[ [ auto | <length-percentage> ]{1,2} ]#',
'view-timeline-name': '[ none | <custom-property-name> ]#',
'view-timeline':
"[ <'view-timeline-name'> [ <'view-timeline-axis'> || <'view-timeline-inset'> ]? ]#",
// <custom-ident> represents any valid CSS identifier that would not be misinterpreted as a pre-defined keyword in that property’s value definition
// i.e. reserved keywords don't have to be excluded explicitly
// w3c/csswg-drafts#9895
'view-transition-name': 'none | <custom-ident>',
'word-break': '| auto-phrase',
...secondaryOptions?.propertiesSyntax,
};
// TODO csstree/csstree#244

/**
* @todo add support for oklab(), oklch(), color(), color-mix(), light-dark(), etc.
* @see https://drafts.csswg.org/css-color-5/
*/
const typesSyntax = { ...secondaryOptions?.typesSyntax };

/** @type {Map<string, string>} */
Expand Down
18 changes: 16 additions & 2 deletions lib/rules/declaration-property-value-no-unknown/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,32 @@ const rule = (primary, secondaryOptions) => {
const propertiesSyntax = {
overflow: '| overlay', // csstree/csstree#248
width: '| min-intrinsic | -moz-min-content | -moz-available | -webkit-fill-available', // csstree/csstree#242
'anchor-name': 'none | <custom-property-name>#',
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'field-sizing': 'content | fixed',
'text-box-edge':
'auto | [ text | cap | ex | ideographic | ideographic-ink ] [ text | alphabetic | ideographic | ideographic-ink ]?',
'text-box-trim': 'none | trim-start | trim-end | trim-both',
'text-spacing-trim': 'normal | space-all | space-first | trim-start',
'word-break': '| auto-phrase',
'text-wrap-mode': 'wrap | nowrap',
'text-wrap-style': 'auto | balance | pretty | stable',
'text-wrap': "<'text-wrap-mode'> || <'text-wrap-style'>",
'view-timeline-axis': '[ block | inline | x | y ]#',
'view-timeline-inset': '[ [ auto | <length-percentage> ]{1,2} ]#',
'view-timeline-name': '[ none | <custom-property-name> ]#',
'view-timeline':
"[ <'view-timeline-name'> [ <'view-timeline-axis'> || <'view-timeline-inset'> ]? ]#",
// <custom-ident> represents any valid CSS identifier that would not be misinterpreted as a pre-defined keyword in that property’s value definition
// i.e. reserved keywords don't have to be excluded explicitly
// w3c/csswg-drafts#9895
'view-transition-name': 'none | <custom-ident>',
'word-break': '| auto-phrase',
...secondaryOptions?.propertiesSyntax,
};
// TODO csstree/csstree#244

/**
* @todo add support for oklab(), oklch(), color(), color-mix(), light-dark(), etc.
* @see https://drafts.csswg.org/css-color-5/
*/
const typesSyntax = { ...secondaryOptions?.typesSyntax };

/** @type {Map<string, string>} */
Expand Down