.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / function-url-scheme-whitelist / README.md
1 # function-url-scheme-whitelist
2
3 Specify a whitelist of allowed URL schemes.
4
5 ```css
6 a { background-image: url('http://www.example.com/file.jpg'); }
7 /**                        ↑
8  *           This URL scheme */
9 ```
10
11 A [URL scheme](https://url.spec.whatwg.org/#syntax-url-scheme) consists of alphanumeric, `+`, `-`, and `.` characters. It can appear at the start of a URL and is followed by `:`.
12
13 This rule treats URL schemes as case insensitive (`https` and `HTTPS` are the same).
14
15 This rule ignores URL arguments without an existing URL scheme.
16
17 This rule ignores URL arguments with variables or variable interpolation (`$sass`, `@less`, `--custom-property`, `#{$var}`, `@{var}`, `$(var)`).
18
19 ## Options
20
21 `array|string|regex`: `["array", "of", "schemes" or "regex"]|"scheme"|/regex/`
22
23 Given:
24
25 ```js
26 ["data", "/^http/"]
27 ```
28
29 The following patterns are considered violations:
30
31 ```css
32 a { background-image: url('http://www.example.com/file.jpg'); }
33 ```
34
35 ```css
36 a { background-image: url('file://file.jpg'); }
37 ```
38
39 The following patterns are *not* considered violations:
40
41 ```css
42 a { background-image: url('example.com/file.jpg'); }
43 ```
44
45 ```css
46 a { background-image: url('/example.com/file.jpg'); }
47 ```
48
49 ```css
50 a { background-image: url('//example.com/file.jpg'); }
51 ```
52
53 ```css
54 a { background-image: url('./path/to/file.jpg'); }
55 ```
56
57 ```css
58 a { background-image: url('http://www.example.com/file.jpg'); }
59 ```
60
61 ```css
62 a { background-image: url('https://www.example.com/file.jpg'); }
63 ```
64
65 ```css
66 a { background-image: url('HTTPS://www.example.com/file.jpg'); }
67 ```
68
69 ```css
70 a { background-image: url('data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs='); }
71 ```