|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- # function-url-scheme-disallowed-list
-
- Specify a list of disallowed URL schemes.
-
- <!-- prettier-ignore -->
- ```css
- a { background-image: url('http://www.example.com/file.jpg'); }
- /** ↑
- * This URL scheme */
- ```
-
- 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 `:`.
-
- This rule ignores:
-
- - URL arguments without an existing URL scheme
- - URL arguments with variables or variable interpolation (`$sass`, `@less`, `--custom-property`, `#{$var}`, `@{var}`, `$(var)`)
-
- ## Options
-
- `array|string|regex`: `["array", "of", /schemes/ or "/regex/"]|"scheme"|/regex/`
-
- Given:
-
- ```
- ["ftp", "/^http/"]
- ```
-
- The following patterns are considered violations:
-
- <!-- prettier-ignore -->
- ```css
- a { background-image: url('ftp://www.example.com/file.jpg'); }
- ```
-
- <!-- prettier-ignore -->
- ```css
- a { background-image: url('http://www.example.com/file.jpg'); }
- ```
-
- <!-- prettier-ignore -->
- ```css
- a { background-image: url('https://www.example.com/file.jpg'); }
- ```
-
- The following patterns are _not_ considered violations:
-
- <!-- prettier-ignore -->
- ```css
- a { background-image: url('data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs='); }
- ```
-
- <!-- prettier-ignore -->
- ```css
- a { background-image: url('example.com/file.jpg'); }
- ```
-
- <!-- prettier-ignore -->
- ```css
- a { background-image: url('/example.com/file.jpg'); }
- ```
-
- <!-- prettier-ignore -->
- ```css
- a { background-image: url('//example.com/file.jpg'); }
- ```
-
- <!-- prettier-ignore -->
- ```css
- a { background-image: url('./path/to/file.jpg'); }
- ```
|