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