Skip to main content

function-url-quotes

需要或禁止 URL 引号。

¥Require or disallow quotes for urls.

a { background: url("x.jpg") }
/** ↑ ↑

* These quotes */

fix 选项 可以自动修复此规则报告的大部分问题。

¥The fix option can automatically fix most of the problems reported by this rule.

选项

¥Options

string"always"|"never"

"always"

URL 必须始终加引号。

¥Urls must always be quoted.

以下模式被视为问题:

¥The following patterns are considered problems:

@import url(foo.css);
@font-face { font-family: 'foo'; src: url(foo.ttf); }

以下模式不被视为问题:

¥The following patterns are not considered problems:

a { background: url('x.jpg'); }
@import url("foo.css");
@font-face { font-family: "foo"; src: url("foo.ttf"); }

"never"

绝对不能引用 URL。

¥Urls must never be quoted.

以下模式被视为问题:

¥The following patterns are considered problems:

a { background: url('x.jpg'); }
@import url("foo.css");
@font-face { font-family: "foo"; src: url('foo.ttf'); }

以下模式不被视为问题:

¥The following patterns are not considered problems:

a { background: url(x.jpg); }
@import url(foo.css);
@font-face { font-family: 'foo'; src: url(foo.ttf); }

可选的辅助选项

¥Optional secondary options

except: ["empty"]

反转没有参数的函数的主要选项。

¥Reverse the primary option for functions that have no arguments.

例如,"always"

¥For example, with "always".

以下模式不被视为问题:

¥The following patterns are not considered problems:

@-moz-document url-prefix() {}