Skip to content

Files

Latest commit

f6fbad3 · Jul 14, 2017

History

History
This branch is 3808 commits behind stylelint/stylelint:main.

selector-attribute-operator-space-before

selector-attribute-operator-space-before

Require a single space or disallow whitespace before operators within attribute selectors.

[target =_blank]
/**     ↑    
 * The space before operator */

Options

string: "always"|"never"

"always"

There must always be a single space before the operator.

The following patterns are considered violations:

[target=_blank] {}
[target= _blank] {}
[target='_blank'] {}
[target="_blank"] {}
[target= '_blank'] {}
[target= "_blank"] {}

The following patterns are not considered violations:

[target] {}
[target =_blank] {}
[target ='_blank'] {}
[target ="_blank"] {}
[target = _blank] {}
[target = '_blank'] {}
[target = "_blank"] {}

"never"

There must never be a single space before the operator.

The following patterns are considered violations:

[target =_blank] {}
[target = _blank] {}
[target ='_blank'] {}
[target ="_blank"] {}
[target = '_blank'] {}
[target = "_blank"] {}

The following patterns are not considered violations:

[target] {}
[target=_blank] {}
[target='_blank'] {}
[target="_blank"] {}
[target= _blank] {}
[target= '_blank'] {}
[target= "_blank"] {}