Problem/Motivation

Follow-up to #2865971: Use stylelint as opposed to csslint in core. Configure the color-hex-case to be consistent with https://www.drupal.org/docs/develop/standards/css/css-coding-standards

From the CSS Formatting Guidelines:

When hex values are used for colors, use lowercase. Colors may be expressed with any valid CSS value, such as hex value, color keyword, rgb() or rgba(). Note that IE8 does not support all color syntaxes and will require a fallback value.

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

CommentFileSizeAuthor
#3 2939940-3.patch15.89 KBbmx269

Comments

joelpittet created an issue. See original summary.

joelpittet’s picture

Status: Needs work » Active
bmx269’s picture

Status: Active » Needs review
StatusFileSize
new15.89 KB

Patch for testing.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Used git diff --color-words to see the changes were only the hex case changes for this one.

Then ran the linter with and without the CSS changes to make sure we caught all the cases.

Thanks @bmx269 and @alexpott!

alexpott’s picture

Update commit credit.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 66f7227 and pushed to 8.6.x. Thanks!

Cherrypicked back to 8.5.x by ignoring the umami theme. Committed bb9c5a2 and pushed to 8.5.x. Thanks!

  • alexpott committed 66f7227 on 8.6.x
    Issue #2939940 by bmx269, joelpittet: Update stylelint rules color-hex-...

  • alexpott committed 8121e64 on 8.5.x
    Issue #2939940 by bmx269, joelpittet: Update stylelint rules color-hex-...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.