1 | # custom-media-pattern
|
2 |
|
3 | Specify a pattern for custom media query names.
|
4 |
|
5 |
|
6 | ```css
|
7 | @custom-media --foo (max-width: 30em);
|
8 | /** ↑
|
9 | * The pattern of this */
|
10 | ```
|
11 |
|
12 | ## Options
|
13 |
|
14 | `regex|string`
|
15 |
|
16 | A string will be translated into a RegExp like so `new RegExp(yourString)` — so be sure to escape properly.
|
17 |
|
18 | Given the string:
|
19 |
|
20 | ```js
|
21 | "foo-.+";
|
22 | ```
|
23 |
|
24 | The following patterns are considered violations:
|
25 |
|
26 |
|
27 | ```css
|
28 | @custom-media --bar (min-width: 30em);
|
29 | ```
|
30 |
|
31 | The following patterns are _not_ considered violations:
|
32 |
|
33 |
|
34 | ```css
|
35 | @custom-media --foo-bar (min-width: 30em);
|
36 | ```
|