stylelint
Version:
A mighty, modern CSS linter.
75 lines (55 loc) • 1.41 kB
Markdown
# media-feature-name-value-whitelist
Specify a whitelist of allowed media feature name and value pairs.
```css
/** ↑ ↑
* These features and values */
```
## Options
```js
{
"unprefixed-media-feature-name": ["array", "of", "values"],
"/unprefixed-media-feature-name/": ["/regex/", "non-regex", /real-regex/]
}
```
If a media feature name is found in the object, only its whitelisted values are
allowed. If the media feature name is not included in the object, anything goes.
If a name or value is surrounded with `/` (e.g. `"/width$/"`), it is interpreted
as a regular expression. For example, `/width$/` will match `max-width` and
`min-width`.
Given:
```json
{
"min-width": ["768px", "1024px"],
"/resolution/": ["/dpcm$/"]
}
```
The following patterns are considered violations:
```css
```
```css
```
```css
```
The following patterns are *not* considered violations:
```css
```
```css
```
```css
```
```css
```
```css
```
```css
```