Problem/Motivation

Follow-up to #2865971: Use stylelint as opposed to csslint in core. Configure the number-no-trailing-zeros 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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

jpassetti’s picture

Assigned: Unassigned » jpassetti

Working on this at d4d boston sprint.

jpassetti’s picture

Version: 8.3.x-dev » 8.4.x-dev
Assigned: jpassetti » Unassigned
Status: Active » Needs review
FileSize
4.62 KB

Getting rid of trailing zeros made sense to me. I removed the no-trailing-zeros rule from .stylelintrc.json file so it would inherit from the base rule set. I fixed all of the issues.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Ran the core npm with the patch applied and no errors, checked out one of the files to see it fail and it totally did so I know the change is working. Thanks for doing these @jpassetti and @alexpott

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

I agree it makes sense... less bytes to send and all. Unfortunately the patch does not apply anymore.

harsha012’s picture

Status: Needs work » Needs review
FileSize
4.62 KB

re-rolled the patch

Status: Needs review » Needs work

The last submitted patch, 8: 2866819-8.patch, failed testing. View results

harsha012’s picture

Status: Needs work » Needs review
FileSize
5.69 KB

re-rolled the patch

alexpott’s picture

Status: Needs review » Needs work
+++ b/core/themes/seven/css/components/jquery.ui/theme.css
@@ -347,8 +347,8 @@
-  border-left-color: #D2D2D2;
-  border-right-color: #D2D2D2;
+  border-left-color: #d2d2d2;
+  border-right-color: #d2d2d2;

@@ -375,7 +375,7 @@
-  border: 1px solid #A6A6A6;
+  border: 1px solid #a6a6a6;

@@ -383,8 +383,8 @@
-  border-bottom: 1px solid #A6A6A6;
-  border-top: 1px solid #A6A6A6;
+  border-bottom: 1px solid #a6a6a6;
+  border-top: 1px solid #a6a6a6;

+++ b/core/themes/seven/css/theme/ckeditor-dialog.css
@@ -196,7 +196,7 @@
-  border: 1px solid #3AB2FF;
+  border: 1px solid #3ab2ff;

I think these changes are out-of-scope.

harsha012’s picture

Status: Needs work » Needs review
FileSize
4.92 KB
1019 bytes

Fixed changes as per #11

joelpittet’s picture

Status: Needs review » Needs work

The change to remove "length-zero-no-unit": null, in core/.stylelintrc.json should not be in this patch, could it be removed please?

harsha012’s picture

Status: Needs work » Needs review
FileSize
4.54 KB
307 bytes

fixed as per comment #14

alexpott’s picture

Status: Needs review » Needs work

@harsha012 the patch in #14 is still missing the removal of the line from core/.stylelintrc.json

harsha012’s picture

Status: Needs work » Needs review
FileSize
4.92 KB
324 bytes
joelpittet’s picture

Status: Needs review » Needs work
Issue tags: -Needs reroll

Thanks @harsha012. There seems to be an unrelated change in there still like @alexpott mentioned in #11.

Since this patch is about trailing 0's these changes to case are not needed.

+++ b/core/themes/seven/css/theme/ckeditor-dialog.cs
-  border: 1px solid #3AB2FF;
+  border: 1px solid #3ab2ff;

Very close though!

harsha012’s picture

Status: Needs work » Needs review
FileSize
4.62 KB

fixed it.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @harsha012, @jpassetti, and @alexpott!

It's catching the rule when I testnpm run lint:css without the changes and the changes pass all tests.

I double checked an all the extra changes have been removed.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed e965387 and pushed to 8.5.x. Thanks!

  • alexpott committed e965387 on 8.5.x
    Issue #2866819 by harsha012, jpassetti, joelpittet: Update stylelint...

Status: Fixed » Closed (fixed)

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