Welcome to mirror list, hosted at ThFree Co, Russian Federation.

README.md « media-feature-value-dollar-variable « rules « src « stylelint-scss « node_modules « assets - github.com/fourtyone11/origin-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 59775540b9dd2de58352bab82671cc8af793dc80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# media-feature-value-dollar-variable

Require a media feature value be a `$`-variable or disallow `$`-variables in media feature values.

```scss
@media (max-width: $var) { a { color: red; } }
//                 ↑
// Require or disallow this
}
```

## Options

`string`: `"always"|"never"`

### `"always"`

A media feature value *must consist* of just a single `$`-variable (possibly with inteprolation).

The following patterns are considered warnings:

```scss
@media (max-width: 300px) { b { color: red; } }
```

```scss
@media (max-width: $var + 10px) { b { color: red; } }
```

```scss
@media screen and (max-width: $var), or (min-width: 100px){ b { color: red; } }
```

```scss
@media screen and (max-width: #{$val} + 10px) { a { display: none; } }
```

```scss
@media screen and (max-width: #{$val + $x} ) { a { display: none; } }
```

```scss
@media screen and (min-width: funcName($p)){ b { color: red; } }
```

The following patterns are *not* considered warnings:

```scss
@media ( max-width: $var ) {b { color: red; }}
```

```scss
@media ( max-width: #{$var}) {b { color: red; }}
```

### `"never"`

There *must never* be a `$`-variable in a media feature value. Even as a parameter to a function call.

The following patterns are considered warnings:

```scss
@media screen and (min-width: $var){ b { color: red; } }
```

```scss
@media screen and (min-width: 100px + $var){ b { color: red; } }
```

```scss
@media screen and (min-width: funcName($var)){ b { color: red; } }
```

The following patterns are *not* considered warnings:

```scss
@media screen and (min-width: 100px){ b { color: red; } }
```

```scss
@media screen and (min-width: 100px + 10px){ b { color: red; } }
```

```scss
@media screen and (min-width: funcName(10px)){ b { color: red; } }
```