Skip to content

Files

Latest commit

 

History

History
43 lines (30 loc) · 902 Bytes

function-url-no-scheme-relative.md

File metadata and controls

43 lines (30 loc) · 902 Bytes

Pattern: Use of scheme-relative URL

Issue: -

Description

Disallow scheme-relative urls. A scheme-relative URL is a URL that begins with // followed by a host.

This rule ignores URL arguments that are variables ($sass, @less, --custom-property).

Examples

The following patterns are considered violations:

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

The following patterns are not considered violations:

a { 
  background: url("../file.jpg"); 
}
a { 
  background: url("http://www.google.com/file.jpg"); 
}
a { 
  background: url("/path/to/file.jpg"); 
}

Further Reading