Skip to content
Draft
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
2 changes: 1 addition & 1 deletion docs/rules/font-family-fallbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ It is a best practice to use a fallback font and a generic font last in the `fon

## Rule Details

This rule enforces the use of fallback fonts and a generic font last in `font-family` and `font` property. Global values (`inherit`, `initial`, `revert`, `revert-layer`, `unset`) are always allowed.
This rule enforces the use of fallback fonts and a generic font last in `font-family` and `font` property. Global values (`inherit`, `initial`, `revert`, `revert-layer`, `revert-rule`, `unset`) are always allowed.

Example of **incorrect** code:

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/relative-font-units.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Generally, relative units such as `rem` or `em` are preferred over absolute ones

## Rule Details

This rule enforces the use of relative units for font size. Relative-size keywords (`smaller`, `larger`) and global values (`inherit`, `initial`, `revert`, `revert-layer`, `unset`) are always allowed. Conversely, absolute-size keywords (`xx-small`, `x-small`, `small`, `medium`, `large`, `x-large`, `xx-large`, `xxx-large`) along with the `math` keyword and any absolute length units (such as `px` or `pt`), are never allowed.
This rule enforces the use of relative units for font size. Relative-size keywords (`smaller`, `larger`) and global values (`inherit`, `initial`, `revert`, `revert-layer`, `revert-rule`, `unset`) are always allowed. Conversely, absolute-size keywords (`xx-small`, `x-small`, `small`, `medium`, `large`, `x-large`, `xx-large`, `xxx-large`) along with the `math` keyword and any absolute length units (such as `px` or `pt`), are never allowed.

## Options

Expand Down
2 changes: 2 additions & 0 deletions tests/rules/font-family-fallbacks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ ruleTester.run("font-family-fallbacks", rule, {
"a { font-family: initial; }",
"a { font-family: revert; }",
"a { font-family: revert-layer; }",
"a { font-family: revert-rule; }",
"a { font-family: unset; }",
"a { font: inherit; }",
"a { font: initial; }",
"a { font: revert; }",
"a { font: revert-layer; }",
"a { font: revert-rule; }",
"a { font: unset; }",
":root { --my-font: sans-serif; } a { font-family: var(--my-font); }",
":root { --foo: 3rem; } a { font-family: var(--my-font); }",
Expand Down
9 changes: 9 additions & 0 deletions tests/rules/no-invalid-properties.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,15 @@ ruleTester.run("no-invalid-properties", rule, {
"a { width: env(titlebar-area-width); }",
"a { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) 0; }",
"a { padding: env(safe-area-inset-top) red }",

// CSS-wide keywords are valid for every property
"a { color: inherit; }",
"a { color: initial; }",
"a { color: unset; }",
"a { color: revert; }",
"a { color: revert-layer; }",
"a { color: revert-rule; }",
"a { width: revert-rule; }",
],
invalid: [
{
Expand Down
2 changes: 2 additions & 0 deletions tests/rules/relative-font-units.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ ruleTester.run("relative-font-units", rule, {
"a { font: revert Arial, sans-serif; }",
"a { font-size: revert-layer; }",
"a { font: revert-layer Arial, sans-serif; }",
"a { font-size: revert-rule; }",
"a { font: revert-rule Arial, sans-serif; }",
"a { font-size: unset; }",
"a { font: unset Arial, sans-serif; }",
"a { font: 1rem/120% Arial, sans-serif; }",
Expand Down
Loading