.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / stylelint / lib / rules / function-url-scheme-blacklist / README.md
1 # function-url-scheme-blacklist
2
3 Specify a blacklist of disallowed 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 ["ftp", "/^http/"]
27 ```
28
29 The following patterns are considered violations:
30
31 ```css
32 a { background-image: url('ftp://www.example.com/file.jpg'); }
33 ```
34
35 ```css
36 a { background-image: url('http://www.example.com/file.jpg'); }
37 ```
38
39 ```css
40 a { background-image: url('https://www.example.com/file.jpg'); }
41 ```
42
43 The following patterns are *not* considered violations:
44
45 ```css
46 a { background-image: url('data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs='); }
47 ```
48
49 ```css
50 a { background-image: url('example.com/file.jpg'); }
51 ```
52
53 ```css
54 a { background-image: url('/example.com/file.jpg'); }
55 ```
56
57 ```css
58 a { background-image: url('//example.com/file.jpg'); }
59 ```
60
61 ```css
62 a { background-image: url('./path/to/file.jpg'); }
63 ```