1
0
mirror of https://github.com/thangisme/notes.git synced 2024-09-26 14:06:00 -04:00
notes/node_modules/stylelint/lib/rules/function-url-data-uris
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00
..
index.js Initial commit 2017-03-09 13:16:08 -05:00
README.md Initial commit 2017-03-09 13:16:08 -05:00

function-url-data-uris

Require or disallow data URIs for urls.

a { background-image: url('data:image/gif;base64,R0lGODlh='); }
/**                        ↑ 
 *                  This data URI */

This rule ignores variables inside url function ($sass, @less, --custom-property).

Options

string: "always"|"never"

"always"

There must always be data URIs in url.

The following patterns are considered warnings:

a { 
  background-image: url(image.gif) 
} 
@font-face { 
  font-family: 'foo'; 
  src: url(foo.ttf); 
}

The following patterns are not considered warnings:

a {
  background-image: url('data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=')
}
@font-face { 
  font-family: 'foo'; 
  src: url(data:font/ttf;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=); 
}

"never"

There must never be data URIs in url.

The following patterns are considered warnings:

a {
  background-image: url('data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=')
}
@font-face { 
  font-family: 'foo'; 
  src: url(data:font/ttf;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=); 
}

The following patterns are not considered warnings:

a {
  background-image: url(image.gif) 
}
@font-face { 
  font-family: 'foo'; 
  src: url(foo.ttf); 
}