|
| 1 | +# at-rule-descriptor-value-no-unknown |
| 2 | + |
| 3 | +Disallow unknown values for descriptors within at-rules. |
| 4 | + |
| 5 | +<!-- prettier-ignore --> |
| 6 | +```css |
| 7 | +@counter-style foo { |
| 8 | + system: unknown; |
| 9 | +/** ↑ |
| 10 | + * Values like this */ |
| 11 | +} |
| 12 | +``` |
| 13 | + |
| 14 | +This rule considers descriptors and values defined in the CSS Specifications, up to and including Editor's Drafts, to be known. |
| 15 | + |
| 16 | +You can filter the [CSSTree Syntax Reference](https://csstree.github.io/docs/syntax/) to find out what values are valid for a descriptor of an at-rule. |
| 17 | + |
| 18 | +This rule is only appropriate for CSS. You should not turn it on for CSS-like languages, such as SCSS or Less. |
| 19 | + |
| 20 | +The [`message` secondary option](https://github.com/stylelint/stylelint/16.17.0/docs/user-guide/configure.md#message) can accept the arguments of this rule. |
| 21 | + |
| 22 | +This rule checks descriptor values within at-rules. You can use [`declaration-property-value-no-unknown`](https://github.com/stylelint/stylelint/16.17.0/lib/rules/declaration-property-value-no-unknown/README.md) to disallow unknown values for properties within declarations, and [`at-rule-descriptor-no-unknown`](https://github.com/stylelint/stylelint/16.17.0/lib/rules/at-rule-descriptor-no-unknown/README.md) to disallow unknown descriptors for at-rules. |
| 23 | + |
| 24 | +This rule overlaps with: |
| 25 | + |
| 26 | +- [`color-no-invalid-hex`](https://github.com/stylelint/stylelint/16.17.0/lib/rules/color-no-invalid-hex/README.md) |
| 27 | +- [`function-linear-gradient-no-nonstandard-direction`](https://github.com/stylelint/stylelint/16.17.0/lib/rules/function-linear-gradient-no-nonstandard-direction/README.md) |
| 28 | +- [`function-no-unknown`](https://github.com/stylelint/stylelint/16.17.0/lib/rules/function-no-unknown/README.md) |
| 29 | +- [`string-no-newline`](https://github.com/stylelint/stylelint/16.17.0/lib/rules/string-no-newline/README.md) |
| 30 | +- [`unit-no-unknown`](https://github.com/stylelint/stylelint/16.17.0/lib/rules/unit-no-unknown/README.md) |
| 31 | + |
| 32 | +You can either turn off the rules or configure them to ignore the overlaps. |
| 33 | + |
| 34 | +For customizing syntax, see the [`languageOptions`](https://github.com/stylelint/stylelint/16.17.0/docs/user-guide/configure.md#languageoptions) section. |
| 35 | + |
| 36 | +Prior art: |
| 37 | + |
| 38 | +- [stylelint-csstree-validator](https://www.npmjs.com/package/stylelint-csstree-validator) |
| 39 | + |
| 40 | +## Options |
| 41 | + |
| 42 | +### `true` |
| 43 | + |
| 44 | +The following patterns are considered problems: |
| 45 | + |
| 46 | +<!-- prettier-ignore --> |
| 47 | +```css |
| 48 | +@counter-style foo { |
| 49 | + system: unknown; |
| 50 | +} |
| 51 | +``` |
| 52 | + |
| 53 | +<!-- prettier-ignore --> |
| 54 | +```css |
| 55 | +@property --foo { |
| 56 | + syntax: unknown; |
| 57 | +} |
| 58 | +``` |
| 59 | + |
| 60 | +The following patterns are _not_ considered problems: |
| 61 | + |
| 62 | +<!-- prettier-ignore --> |
| 63 | +```css |
| 64 | +@counter-style foo { |
| 65 | + system: numeric; |
| 66 | +} |
| 67 | +``` |
| 68 | + |
| 69 | +<!-- prettier-ignore --> |
| 70 | +```css |
| 71 | +@property --foo { |
| 72 | + syntax: "<color>"; |
| 73 | +} |
| 74 | +``` |
0 commit comments