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-pseudo-element-colon-notation
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 |
---|---|---|---|
#13 | 2866822-13.patch | 81.16 KB | occupant |
#7 | 2866822-7.patch | 3.67 KB | harsha012 |
#3 | selector-pseudo-element-colon-notation-2866822-3.patch | 3.52 KB | Mukeysh |
Comments
Comment #2
alexpottComment #3
Mukeysh CreditAttribution: Mukeysh as a volunteer and at gai Technologies Pvt Ltd for gai Technologies Pvt Ltd commentedAdded patch for this.
Comment #5
joelpittetLooks like some new errors snuck in during the time it took to review, sorry about that.
Comment #6
joelpittetComment #7
harsha012 CreditAttribution: harsha012 as a volunteer and at Red Crackle commentedre-rolled the patch
Comment #8
joelpittetThanks @harsha, looking at this closer this looks wrong,
::
is the standard we should be using.I think we should be following the CSS3 spec and it is supported in our supported browsers.
https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements
I propose:
pseudo-element = double
pseudo-selector = single
Comment #9
joelpittetMore like needs discussion but maybe NW is appropriate?
Comment #10
jofitz CreditAttribution: jofitz at ComputerMinds commentedRemoved Needs Reroll tag.
Comment #12
joelpittetThought's on #8?
Comment #13
occupant@joelpittet Agreed about following the spec.
Rerolling patch with active lint rule set to:
"selector-pseudo-element-colon-notation": "double"
Comment #14
codexmas CreditAttribution: codexmas as a volunteer and at Acquia commented#13 applied cleanly.
Output from linting command:
Comment #15
leahtard CreditAttribution: leahtard at The Jibe commentedI agree with the standard @joelpittet mentions in #8:
pseudo-element = double
pseudo-selector = single
The patch applied cleanly and passed the linter like @codexmas mentioned.
Cheers, Leah
Comment #17
joelpittetUnrelated testbot failure, resetting status. Thanks for the reviews @codexmas and @leahtard
Comment #18
alexpottWe still need to actually make this the standard - which means we need coding standards issue and agreement with the technical working group and then update the standard and then implement the patch.
Comment #28
longwaveDuplicate of #3343212: Update Core CSS to use double-colon for pseudo elements which is currently active - transferred credit over there.