1"use strict";(self.webpackChunkstylelint_io=self.webpackChunkstylelint_io||[]).push([["9762"],{4878:function(e,n,a){a.r(n),a.d(n,{metadata:function(){return i},default:function(){return o},frontMatter:function(){return r},contentTitle:function(){return t},toc:function(){return c},assets:function(){return d}});var i=JSON.parse('{"id":"user-guide/rules/media-feature-name-allowed-list","title":"media-feature-name-allowed-list","description":"Specify a list of allowed media feature names.","source":"@site/docs/user-guide/rules/media-feature-name-allowed-list.md","sourceDirName":"user-guide/rules","slug":"/user-guide/rules/media-feature-name-allowed-list","permalink":"/user-guide/rules/media-feature-name-allowed-list","draft":false,"unlisted":false,"editUrl":"https://github.com/stylelint/stylelint/edit/main/lib/rules/media-feature-name-allowed-list/README.md","tags":[],"version":"current","frontMatter":{"title":"media-feature-name-allowed-list","sidebar_label":"media-feature-name-allowed-list"},"sidebar":"docs","previous":{"title":"max-nesting-depth","permalink":"/user-guide/rules/max-nesting-depth"},"next":{"title":"media-feature-name-disallowed-list","permalink":"/user-guide/rules/media-feature-name-disallowed-list"}}'),s=a(4848),l=a(8453);let r={title:"media-feature-name-allowed-list",sidebar_label:"media-feature-name-allowed-list"},t="media-feature-name-allowed-list",d={},c=[{value:"Options",id:"options",level:2},{value:"<code>Array<string></code>",id:"arraystring",level:3}];function m(e){let n={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"media-feature-name-allowed-list",children:"media-feature-name-allowed-list"})}),"\n",(0,s.jsx)(n.p,{children:"Specify a list of allowed media feature names."}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"@media (min-width: 700px) {}\n/** \u2191\n * This media feature name */\n"})}),"\n",(0,s.jsxs)(n.p,{children:["This rule supports 1 ",(0,s.jsx)(n.a,{href:"/user-guide/configure#message",children:"message argument"}),": the disallowed media feature name."]}),"\n",(0,s.jsx)(n.h2,{id:"options",children:"Options"}),"\n",(0,s.jsx)(n.h3,{id:"arraystring",children:(0,s.jsx)(n.code,{children:"Array<string>"})}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'["array", "of", "media-features", "/regex/"]\n'})}),"\n",(0,s.jsx)(n.p,{children:"Given:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'{\n "media-feature-name-allowed-list": ["max-width", "/^my-/"]\n}\n'})}),"\n",(0,s.jsx)(n.p,{children:"The following patterns are considered problems:"}),"\n",(0,s.jsxs)("div",{class:"invalid-pattern",children:[(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"@media (min-width: 50em) {}\n"})}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"@media print and (min-resolution: 300dpi) {}\n"})}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"@media (min-width < 50em) {}\n"})}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"@media (10em < min-width < 50em) {}\n"})})]}),"\n",(0,s.jsxs)(n.p,{children:["The following patterns are ",(0,s.jsx)(n.em,{children:"not"})," considered problems:"]}),"\n",(0,s.jsxs)("div",{class:"valid-pattern",children:[(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"@media (max-width: 50em) {}\n"})}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"@media (my-width: 50em) {}\n"})}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"@media (max-width > 50em) {}\n"})}),(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-css",children:"@media (10em < my-width < 50em) {}\n"})})]})]})}function o(e={}){let{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(m,{...e})}):m(e)}},8453:function(e,n,a){a.d(n,{R:function(){return r},x:function(){return t}});var i=a(6540);let s={},l=i.createContext(s);function r(e){let n=i.useContext(l);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function t(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:r(e.components),i.createElement(l.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.