1 # function-url-scheme-whitelist
3 Specify a whitelist of allowed URL schemes.
6 a { background-image: url('http://www.example.com/file.jpg'); }
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 `:`.
13 This rule treats URL schemes as case insensitive (`https` and `HTTPS` are the same).
15 This rule ignores URL arguments without an existing URL scheme.
17 This rule ignores URL arguments with variables or variable interpolation (`$sass`, `@less`, `--custom-property`, `#{$var}`, `@{var}`, `$(var)`).
21 `array|string|regex`: `["array", "of", "schemes" or "regex"]|"scheme"|/regex/`
29 The following patterns are considered violations:
32 a { background-image: url('http://www.example.com/file.jpg'); }
36 a { background-image: url('file://file.jpg'); }
39 The following patterns are *not* considered violations:
42 a { background-image: url('example.com/file.jpg'); }
46 a { background-image: url('/example.com/file.jpg'); }
50 a { background-image: url('//example.com/file.jpg'); }
54 a { background-image: url('./path/to/file.jpg'); }
58 a { background-image: url('http://www.example.com/file.jpg'); }
62 a { background-image: url('https://www.example.com/file.jpg'); }
66 a { background-image: url('HTTPS://www.example.com/file.jpg'); }
70 a { background-image: url('data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs='); }