1
0
mirror of https://github.com/thangisme/notes.git synced 2024-11-01 05:27:15 -04:00
notes/node_modules/stylelint/lib/rules/function-url-scheme-whitelist/README.md
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00

1.5 KiB

function-url-scheme-whitelist

Specify a whitelist of allowed url schemes.

a { background-image: url('http://www.example.com/file.jpg'); }
/**                        ↑
 *           This url scheme */

A 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:

["https", "data"]

The following patterns are considered warnings:

a { background-image: url('http://www.example.com/file.jpg'); }
a { background-image: url('ftp://www.example.com/file.jpg'); }

The following patterns are not considered warnings:

a { background-image: url('https://www.example.com/file.jpg'); }
a { background-image: url('HTTPS://www.example.com/file.jpg'); }
a { background-image: url('data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs='); }
a { background-image: url('example.com/file.jpg'); }
a { background-image: url('/example.com/file.jpg'); }
a { background-image: url('//example.com/file.jpg'); }
a { background-image: url('./path/to/file.jpg'); }