Our CSS Coding conventions don't include the a clear guideline on quoting or not quoting attribute selectors.
There is an extensive article on when it is valid to unquote attribute selectors by Mathias Bynens:
a valid unquoted attribute value in CSS is any string of text that is not the empty string, is not just a hyphen (-), consists of escaped characters and/or characters matching /[-_\u00A0-\u10FFFF]/ entirely, and doesn’t start with a digit or two hyphens or a hyphen followed by a digit.
Two questions:
- Quote or unquote?
- Which quote – single or double?
It would either make sense to consistently quote all attribute selectors (with one type of quote) and have CSS Minifier delete the syntactical sugar where applicable or unqote per default where applicable (majority of the cases apart from content.externallinks.css which doesn't seem to be in use any more. If we decide pro quoting we should also revisit guidelines on url( image.png ) values there
Further reading
JavaScript coding guidelines pledge for single quotes on string literals, although it doesn't clarify on HTML constructs like
$content.find( 'input[type="checkbox"]:not(.noshiftselect)' ).checkboxShiftClick();
Src: MW core
var $checkboxes = $( 'li input[type=checkbox]' );
Src: MW core
JavaScript coding conventions do include a specific sentence on CSS attribute selectors pitfalls in jQuery, though linking to an invalid jQuery bug, where the author featured an invalid selector:
Consistently quote attribute selector values: [foo="bar"] instead of [foo=bar] (jqbug 8229).