UNPKG

929 BMarkdownView Raw
1# function-url-no-scheme-relative
2
3Disallow scheme-relative urls.
4
5<!-- prettier-ignore -->
6```css
7a { background-image: url('//www.google.com/file.jpg'); }
8/** ↑
9 * This scheme-relative url */
10```
11
12A [scheme-relative url](https://url.spec.whatwg.org/#syntax-url-scheme-relative) is a url that begins with `//` followed by a host.
13
14This rule ignores url arguments that are variables (`$sass`, `@less`, `--custom-property`).
15
16## Options
17
18### `true`
19
20The following patterns are considered violations:
21
22<!-- prettier-ignore -->
23```css
24a {
25 background: url("//www.google.com/file.jpg");
26}
27```
28
29The following patterns are _not_ considered violations:
30
31<!-- prettier-ignore -->
32```css
33a {
34 background: url("../file.jpg");
35}
36```
37
38<!-- prettier-ignore -->
39```css
40a {
41 background: url("http://www.google.com/file.jpg");
42}
43```
44
45<!-- prettier-ignore -->
46```css
47a {
48 background: url("/path/to/file.jpg");
49}
50```