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 and, if possible, the shorthand syntax, e.g. #aaa. 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

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Issue summary: View changes
BrightBold’s picture

Issue summary: View changes
droplet’s picture

Version: 8.3.x-dev » 8.4.x-dev
Status: Active » Needs review
Issue tags: +stylelint
FileSize
25.86 KB

Status: Needs review » Needs work

The last submitted patch, 5: 2866801-4.patch, failed testing.

BrightBold’s picture

Assigned: Unassigned » BrightBold
BrightBold’s picture

Rerolled.

@droplet's patch also fixes #2866802: Update stylelint rule color-hex-length to be consistent with Drupal's CSS standards so rather than separating that work into two patches that will have a lot of conflicts, we took the liberty of closing that issue as a duplicate.

BrightBold’s picture

Title: Update stylelint rule color-hex-case to be consistent with Drupal's CSS standards » Update stylelint rules color-hex-case and color-hex-length to be consistent with Drupal's CSS standards
BrightBold’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 8: stylelint-color-hex-case-2866801-8.patch, failed testing. View results

BrightBold’s picture

I have no idea what that failure means or how to fix it. Maybe @droplet, who created the patch knows? If someone more knowledgeable could provide guidance that would be appreciated.

droplet’s picture

\core\modules\color\tests\modules\color_test\themes\color_test_theme\color\color.inc

this file I bet. Needed change to short hex.

BrightBold’s picture

@droplet — is there an issue for that that we can link here? Or would it be appropriate to include that change in this issue?

droplet’s picture

Fix it this issue. We bring in the bug from here.

Akshay kashyap’s picture

@droplet i have added my patch please check it is working fine?

Akshay kashyap’s picture

Status: Needs work » Needs review
droplet’s picture

@Akshay

Thanks. What did you change? I don't see any changes to color.inc.

Status: Needs review » Needs work

The last submitted patch, 16: stylelint-color-hex-case-2866801-15.patch, failed testing. View results