Problem/Motivation
Follow-up to #2865971: Use stylelint as opposed to csslint in core. Configure the declaration-colon-space-after
to be consistent with https://www.drupal.org/docs/develop/standards/css/css-coding-standards
From the CSS Formatting Guidelines:
Include a space after each comma in comma-separated property or function values.
Proposed resolution
Brief instructions on running stylelint - you'll need npm...
All the commands below take place in DRUPAL_ROOT/core
To install stylelint
npm install
This will install Drupal 8's npm dependencies of which stylelint is one.
To run it on all core css files. Apply this issue's patch and do the following command from DRUPAL_ROOT/core
npm run lint:css
Remaining tasks
User interface changes
None
API changes
None
Comments
Comment #2
alexpottComment #3
BrightBoldComment #4
BrightBoldThis patch depends on the patch from #2865971-41: Use stylelint as opposed to csslint in core.
Also, I noticed there were a section in the CSS Formatting Guidelines for "exceptions and slight deviations." Formatting of vendor-prefixed properties wasn't covered there, but frequently in the CSS people had those values right-aligned. I wasn't sure whether that was an omission in the coding standard or whether we wanted to change them all to pass this lint condition, so I'll do one patch each way. This patch assumes that vendor prefixes are an exception to the colon-space rule.
Comment #5
BrightBoldSame as above but also includes the patch from #2865971-41: Use stylelint as opposed to csslint in core, because the patch above will fail testing since it's dependent on stuff that hasn't been committed.
Comment #6
BrightBoldThis patch depends on the patch from #2865971-41: Use stylelint as opposed to csslint in core and as such will not pass tests until that patch is committed.
It assumes we don't want special alignment for vendor prefixes and those have now all been fixed to comply to the declaration-colon-space rule.
There are three stylesheets that still generate linting errors because they fall under this exception:
Those three stylesheets are:
Comment #7
BrightBoldSame as patch in #6 but includes the patch from #2865971-41: Use stylelint as opposed to csslint in core so it will (hopefully!) pass testing.
Comment #8
BrightBoldComment #9
BrightBoldAargh this replaces the patch in #6 because d'oh.
Comment #10
BrightBoldThis replaces the patch in #7. *headdesk*
Comment #12
BrightBoldComment #13
BrightBoldComment #14
BrightBoldRerolled for 8.4.x, with the assumption we don't want to make an exception for vendor prefixes. (If I guessed that wrong I'll redo it.)
Comment #15
BrightBoldComment #17
joelpittetGiving this a try it looks like it needs a re-roll. The patch looks on target though, thanks for making this @BrightBold
Comment #18
joelpittetActually my bad, applied the patch with the wrong command in the wrong folder. It applies, and I ran the linter with no errors, reran with one of the files reverted to ensure the rule still picked up the spaces and it does.
Comment #19
alexpottCommitted c5654de and pushed to 8.5.x. Thanks!