Problem/Motivation
Follow-up to #2865971: Use stylelint as opposed to csslint in core. Configure the declaration-block-no-duplicate-properties
to be consistent with https://www.drupal.org/docs/develop/standards/css/css-coding-standards
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
Comment | File | Size | Author |
---|---|---|---|
#15 | 2866804-15.patch | 2.99 KB | joelpittet |
#11 | interdiff-2866804-9-11.txt | 1.37 KB | harsha012 |
#11 | 2866804-11.patch | 1.87 KB | harsha012 |
#9 | 2866804-9.patch | 1.95 KB | harsha012 |
#6 | 2866804-duplicate-properties-6.patch | 2.81 KB | BrightBold |
Comments
Comment #2
alexpottComment #3
csd713 CreditAttribution: csd713 at Acquia commentedI have removed few IE-8 only supported properties. one example is below where 'background-color: silver' has been removed.
(modules/ckeditor/css/ckeditor.admin.css)
I also have run the stylelint with below rule.
Comment #5
BrightBoldComment #6
BrightBoldReuploading @csd713's patch from #3 to re-test against 8.4.x, because I'm guessing that's why it didn't apply. (Note: this is the exact same patch; I just couldn't figure out how to get it to retest against a different branch of Drupal without re-uploading.)
Comment #8
joelpittetThis one didn't pickup the duplicate in
core/modules/shortcut/css/shortcut.theme.css
Maybe that change isn't needed. Setting to Needs Work to see what you think.Comment #9
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedplease check
Comment #10
joelpittetThe first values need to be removed not the second ones because in CSS the second one will override the first one and if we remove the second one we will inadvertently change the CSS style.
Comment #11
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedfixed
Comment #12
joelpittetThats better, thanks @harsha012, @BrightBold, @csd713 and @alexpott!
I double checked the 3 hunks and tested the the change with and without the CSS changes to ensure the linter picked up the changes.
Comment #14
alexpottRemoving the
"ignore": "consecutive-duplicates"
brings up these. Are we sure that we want to ignore these?Comment #15
joelpittetI think that was misinterpreted originally, it only seems to remove exact duplicates so it doesn't remove browser compatibility differences only exact duplicates. So yes we should remove that.
Here's a reroll.
There is a regression for umami that snuck in that I didn't fix here because it was fixed in the update stylelint version issue.
profiles/demo_umami/themes/umami/css/components/blocks/banner/banner.css
Comment #16
occupant#15 applies cleanly.
The 3 umami errors for the
function-comma-space-after
rule are there, but @joelpittet has already addressed those.Comment #17
alexpottCommitted 93f9320 and pushed to 8.6.x. Thanks!