PageSourceSearch

https://stylelint.io/assets/js/e0524e2e.4c6f67ff.js

js stylelint.io collected 2026-10-02 02:25:08 UTC 6,565 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkstylelint_io=self.webpackChunkstylelint_io||[]).push([["4708"],{1811:function(e,n,r){r.r(n),r.d(n,{metadata:function(){return s},default:function(){return c},frontMatter:function(){return t},contentTitle:function(){return l},toc:function(){return a},assets:function(){return u}});var s=JSON.parse('{"id":"user-guide/rules/at-rule-descriptor-value-no-unknown","title":"at-rule-descriptor-value-no-unknown","description":"Disallow unknown values for descriptors within at-rules.","source":"@site/docs/user-guide/rules/at-rule-descriptor-value-no-unknown.md","sourceDirName":"user-guide/rules","slug":"/user-guide/rules/at-rule-descriptor-value-no-unknown","permalink":"/user-guide/rules/at-rule-descriptor-value-no-unknown","draft":false,"unlisted":false,"editUrl":"https://github.com/stylelint/stylelint/edit/main/lib/rules/at-rule-descriptor-value-no-unknown/README.md","tags":[],"version":"current","frontMatter":{"title":"at-rule-descriptor-value-no-unknown","sidebar_label":"at-rule-descriptor-value-no-unknown"},"sidebar":"docs","previous":{"title":"at-rule-descriptor-no-unknown","permalink":"/user-guide/rules/at-rule-descriptor-no-unknown"},"next":{"title":"at-rule-disallowed-list","permalink":"/user-guide/rules/at-rule-disallowed-list"}}'),i=r(4848),o=r(8453);let t={title:"at-rule-descriptor-value-no-unknown",sidebar_label:"at-rule-descriptor-value-no-unknown"},l="at-rule-descriptor-value-no-unknown",u={},a=[{value:"Options",id:"options",level:2},{value:"<code>true</code>",id:"true",level:3}];function d(e){let n={a:"a",admonition:"admonition",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.header,{children:(0,i.jsx)(n.h1,{id:"at-rule-descriptor-value-no-unknown",children:"at-rule-descriptor-value-no-unknown"})}),"\n",(0,i.jsx)(n.p,{children:"Disallow unknown values for descriptors within at-rules."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:"@counter-style foo {\n  system: unknown;\n/**       \u2191\n * Values like this */\n}\n"})}),"\n",(0,i.jsx)(n.p,{children:"This rule considers descriptors and values defined in the CSS Specifications, up to and including Editor's Drafts, to be known."}),"\n",(0,i.jsxs)(n.p,{children:["You can filter the ",(0,i.jsx)(n.a,{href:"https://csstree.github.io/docs/syntax/",children:"CSSTree Syntax Reference"})," to find out what values are known for a descriptor of an at-rule, and use the ",(0,i.jsx)(n.a,{href:"/user-guide/configure#languageoptions",children:(0,i.jsx)(n.code,{children:"languageOptions"})})," configuration property to extend it."]}),"\n",(0,i.jsxs)(n.p,{children:["This rule checks descriptor values within at-rules. You can use ",(0,i.jsx)(n.a,{href:"/user-guide/rules/declaration-property-value-no-unknown",children:(0,i.jsx)(n.code,{children:"declaration-property-value-no-unknown"})})," to disallow unknown values for properties within declarations, and ",(0,i.jsx)(n.a,{href:"/user-guide/rules/at-rule-descriptor-no-unknown",children:(0,i.jsx)(n.code,{children:"at-rule-descriptor-no-unknown"})})," to disallow unknown descriptors for at-rules."]}),"\n",(0,i.jsx)(n.admonition,{type:"warning",children:(0,i.jsx)(n.p,{children:"This rule is only appropriate for CSS. You should not turn it on for CSS-like languages, such as SCSS or Less."})}),"\n",(0,i.jsxs)(n.admonition,{type:"note",children:[(0,i.jsx)(n.p,{children:"When using this rule, we recommend turning off these overlapping rules or configuring them to ignore the overlaps:"}),(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/user-guide/rules/color-no-invalid-hex",children:(0,i.jsx)(n.code,{children:"color-no-invalid-hex"})})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/user-guide/rules/function-linear-gradient-no-nonstandard-direction",children:(0,i.jsx)(n.code,{children:"function-linear-gradient-no-nonstandard-direction"})})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/user-guide/rules/function-no-unknown",children:(0,i.jsx)(n.code,{children:"function-no-unknown"})})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/user-guide/rules/string-no-newline",children:(0,i.jsx)(n.code,{children:"string-no-newline"})})}),"\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"/user-guide/rules/unit-no-unknown",children:(0,i.jsx)(n.code,{children:"unit-no-unknown"})})}),"\n"]})]}),"\n",(0,i.jsxs)(n.p,{children:["This rule supports 2 ",(0,i.jsx)(n.a,{href:"/user-guide/configure#message",children:"message arguments"}),": the descriptor and the unknown value."]}),"\n",(0,i.jsx)(n.p,{children:"Prior art:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsx)(n.li,{children:(0,i.jsx)(n.a,{href:"https://www.npmjs.com/package/stylelint-csstree-validator",children:"stylelint-csstree-validator"})}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"options",children:"Options"}),"\n",(0,i.jsx)(n.h3,{id:"true",children:(0,i.jsx)(n.code,{children:"true"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-json",children:'{\n  "at-rule-descriptor-value-no-unknown": true\n}\n'})}),"\n",(0,i.jsx)(n.p,{children:"The following patterns are considered problems:"}),"\n",(0,i.jsxs)("div",{class:"invalid-pattern",children:[(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:"@counter-style foo {\n  system: unknown;\n}\n"})}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:"@property --foo {\n  syntax: unknown;\n}\n"})})]}),"\n",(0,i.jsxs)(n.p,{children:["The following patterns are ",(0,i.jsx)(n.em,{children:"not"})," considered problems:"]}),"\n",(0,i.jsxs)("div",{class:"valid-pattern",children:[(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:"@counter-style foo {\n  system: numeric;\n}\n"})}),(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-css",children:'@property --foo {\n  syntax: "<color>";\n}\n'})})]})]})}function c(e={}){let{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},8453:function(e,n,r){r.d(n,{R:function(){return t},x:function(){return l}});var s=r(6540);let i={},o=s.createContext(i);function t(e){let n=s.useContext(o);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:t(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.