1 | # function-url-quotes
|
2 |
|
3 | Require or disallow quotes for urls.
|
4 |
|
5 | ```css
|
6 | a { background: url("x.jpg") }
|
7 | /** ↑ ↑
|
8 | * These quotes */
|
9 | ```
|
10 |
|
11 | ## Options
|
12 |
|
13 | `string`: `"always"|"never"`
|
14 |
|
15 | ### `"always"`
|
16 |
|
17 | Urls *must always* be quoted.
|
18 |
|
19 | The following patterns are considered violations:
|
20 |
|
21 | ```css
|
22 | @import url(foo.css);
|
23 | ```
|
24 |
|
25 | ```css
|
26 | @document domain(http://www.w3.org/);
|
27 | ```
|
28 |
|
29 | ```css
|
30 | @font-face { font-family: 'foo'; src: url(foo.ttf); }
|
31 | ```
|
32 |
|
33 | ```css
|
34 | @-moz-document url-prefix() {}
|
35 | ```
|
36 |
|
37 | The following patterns are *not* considered violations:
|
38 |
|
39 | ```css
|
40 | a { background: url('x.jpg'); }
|
41 | ```
|
42 |
|
43 | ```css
|
44 | @import url("foo.css");
|
45 | ```
|
46 |
|
47 | ```css
|
48 | @document domain('http://www.w3.org/');
|
49 | ```
|
50 |
|
51 | ```css
|
52 | @font-face { font-family: "foo"; src: url("foo.ttf"); }
|
53 | ```
|
54 |
|
55 | ```css
|
56 | @-moz-document url-prefix('') {}
|
57 | ```
|
58 |
|
59 | ### `"never"`
|
60 |
|
61 | Urls *must never* be quoted.
|
62 |
|
63 | The following patterns are considered violations:
|
64 |
|
65 | ```css
|
66 | a { background: url('x.jpg'); }
|
67 | ```
|
68 |
|
69 | ```css
|
70 | @import url("foo.css");
|
71 | ```
|
72 |
|
73 | ```css
|
74 | @font-face { font-family: "foo"; src: url('foo.ttf'); }
|
75 | ```
|
76 |
|
77 | The following patterns are *not* considered violations:
|
78 |
|
79 | ```css
|
80 | a { background: url(x.jpg); }
|
81 | ```
|
82 |
|
83 | ```css
|
84 | @import url(foo.css);
|
85 | ```
|
86 |
|
87 | ```css
|
88 | @font-face { font-family: 'foo'; src: url(foo.ttf); }
|
89 | ```
|
90 |
|
91 | ## Optional secondary options
|
92 |
|
93 | ### `except: ["empty"]`
|
94 |
|
95 | Reverse the primary option for functions that have no arguments.
|
96 |
|
97 | For example, with `"always"`.
|
98 |
|
99 | The following patterns are *not* considered violations:
|
100 |
|
101 | ```css
|
102 | @-moz-document url-prefix() {}
|
103 | ```
|