Problem/Motivation
Follow-up to #2865971: Use stylelint as opposed to csslint in core. Configure the property-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 |
---|---|---|---|
#11 | 2866820-11.patch | 3.11 KB | yogeshmpawar |
#8 | 2866820-8.patch | 3.57 KB | joelpittet |
#4 | stylelint-property-no-unknown-2866820-4.patch | 400 bytes | BrightBold |
Comments
Comment #2
alexpottComment #3
BrightBoldOnly two properties fail this rule:
tap-highlight-color
andtouch-callout
inmodules/toolbar/css/toolbar.theme.css
andthemes/stable/css/toolbar/toolbar.theme.css
. These properties don't exist but in the stylesheet follow vendor-prefixed rules, so presumably they were put there in an attempt to future-proof the css. Should we leave them or delete them?Comment #4
BrightBoldI wasn't even going to post this but I'm in Patch All The Things mode so here's a patch that only has the property-no-unknown rule set to true. If we don't want to remove the properties that currently don't pass then I guess we could commit this and call it a day.
As with the other stylelint patches I've posted, this won't pass until #2865971-41: Use stylelint as opposed to csslint in core is committed.
Comment #5
BrightBoldComment #6
BrightBoldComment #8
joelpittetI think we should remove those, they are recommended against (see callout at top of links).
https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-touch-callout
https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-tap-highlight-c...
Comment #10
alexpottWe can use the options to configure it to ignore these - https://stylelint.io/user-guide/rules/property-no-unknown/ ie. use the regex to allow
(.*)touch-callout
and(.*)tap-highlight-color
- my regex probably could be improved.Comment #11
yogeshmpawarAdded updated patch because previous patch failed to apply.
Comment #14
joelpittet@alexpott do we need to keep them? I'd just as much like to remove these.
Comment #15
joelpittetplease discuss #10
Comment #16
alexpott@joelpittet I would have thought these were added after testing on touch devices - I'd be loathe to remove them without testing.
Comment #17
joelpittetLet's test this (we'll have to find their initial commit).
Comment #18
alexpott@joelpittet that'd be #1137920: Fix toolbar on small screen sizes and redesign toolbar for desktop
Comment #28
longwave#3332023: Remove non-standard tap-highlight-color and touch-callout CSS properties also proposes removing these, we should enable the rule after that is done.