1
0
mirror of https://github.com/thangisme/notes.git synced 2025-10-15 01:14:42 -04:00

Initial commit

This commit is contained in:
Patrick Marsceill
2017-03-09 13:16:08 -05:00
commit b7b0d0d7bf
4147 changed files with 401224 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
# function-url-scheme-whitelist
Specify a whitelist of allowed url schemes.
```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 treats url schemes as case insensitive (`https` and `HTTPS` are the same).
This rule ignores url arguments without an existing url scheme.
This rule ignores url arguments with variables or variable interpolation (`$sass`, `@less`, `--custom-property`, `#{$var}`, `@{var}`, `$(var)`).
## Options
`array|string`: `["array", "of", "schemes"]|"scheme"`
Given:
```js
["https", "data"]
```
The following patterns are considered warnings:
```css
a { background-image: url('http://www.example.com/file.jpg'); }
```
```css
a { background-image: url('ftp://www.example.com/file.jpg'); }
```
The following patterns are *not* considered warnings:
```css
a { background-image: url('https://www.example.com/file.jpg'); }
```
```css
a { background-image: url('HTTPS://www.example.com/file.jpg'); }
```
```css
a { background-image: url('data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs='); }
```
```css
a { background-image: url('example.com/file.jpg'); }
```
```css
a { background-image: url('/example.com/file.jpg'); }
```
```css
a { background-image: url('//example.com/file.jpg'); }
```
```css
a { background-image: url('./path/to/file.jpg'); }
```