Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Follow-up to #2865971: Use stylelint as opposed to csslint in core. Configure the selector-type-no-unknown
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 |
---|---|---|---|
#12 | interdiff-2866823-10-12.txt | 428 bytes | harsha012 |
#12 | 2866823-12.patch | 1.8 KB | harsha012 |
#10 | interdiff-2866823-6-10.txt | 826 bytes | harsha012 |
#10 | 2866823-10.patch | 1.84 KB | harsha012 |
#6 | 2866823-6.patch | 1.77 KB | harsha012 |
Comments
Comment #2
alexpottComment #3
Mukeysh CreditAttribution: Mukeysh as a volunteer and at gai Technologies Pvt Ltd for gai Technologies Pvt Ltd commentedmade "selector-type-no-unknown": true,
Only found 2 issues with this
themes/seven/css/base/elements.css
124:1 × Unexpected unknown type selector "nobr" selector-type-no-unknown
153:1 × Unexpected unknown type selector "quote" selector-type-no-unknown
Comment #5
joelpittetThe issues don't seem to be fixed in the patch.
Comment #6
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedfixed the as per #5
Comment #7
joelpittetThanks @harsha012 for getting the remainder and @Mukeysh and @alexpott for starting this.
I've applied the patch, tested with and without the changes to see they were caught. Also checked that nobody was trying to use a
<nobr>
tag in core.Everything is wonderful. 👌
Comment #8
alexpottShouldn't we just be removing the rule? This is a change to what's applying to the #drupal-off-canvas styles.
Comment #9
joelpittetOh I didn't catch that, good eye both of those should be removed!
Comment #10
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedfixed as per comment #8
Comment #11
alexpottIf the default is true let's just remove the line here.
Comment #12
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedComment #13
joelpittetThanks @harsha012 and @alexpott. I tested by running the linter with the CSS changes and without them to see that they were being tested.
And looked at the patch to make sure they changes are removing the fake tag selectors
Comment #14
alexpotthttps://caniuse.com/#search=nobr - so no browser supports nobr and quote has never been an html element.
Committed 60a2dc0 and pushed to 8.5.x. Thanks!