Skip to content

Files

Latest commit

 

History

History
73 lines (48 loc) · 1.14 KB

string-quotes.md

File metadata and controls

73 lines (48 loc) · 1.14 KB

Pattern: Malformed quotes around string

Issue: -

Description

Specify single or double quotes around strings. Quotes within comments are ignored.

/* "This is fine" */
/* 'And this is also fine' */

Single quotes in a charset @-rule are ignored as using single quotes in this context is incorrect according the CSS specification.

@charset "utf-8"
/* fine regardless of configuration */

Examples

"single"

Strings must always be wrapped with single quotes.

The following patterns are considered violations:

a { content: "x"; }
a[id="foo"] {}

The following patterns are not considered violations:

a { content: 'x'; }
a[id='foo'] {}

"double"

Strings must always be wrapped with double quotes.

The following patterns are considered violations:

a { content: 'x'; }
a[id='foo'] {}

The following patterns are not considered violations:

a { content: "x"; }
a[id="foo"] {}

Further Reading