Problem/Motivation

Follow-up to #2865971: Use stylelint as opposed to csslint in core. Configure the function-whitespace-after 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

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

alexpott created an issue. See original summary.

Mukeysh’s picture

Status: Active » Needs review
FileSize
1.49 KB

Added patch for this.

martin107’s picture

Status: Needs review » Reviewed & tested by the community

I like the patch,

after reading

https://stylelint.io/user-guide/rules/function-whitespace-after/

everything looks correct

+1 from me.

lauriii’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs issue summary update

We should update the issue summary with the rule this follows in the coding standards

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

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should 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 » Needs work

Yeah this is a bit suspicious of a rule to me too. Setting to NW for #5

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

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.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

joelpittet’s picture

Status: Needs work » Needs review
Issue tags: -Needs issue summary update
FileSize
1.51 KB

They responded quickly and I was reading this incorrectly. CSS concat in content is done with a space and we should have a space on either side.

There is no reference in our standards that match this rule.

I scoured the internet and couldn't find this much but a couple examples that show space on all sides which we should follow:
https://developer.mozilla.org/en-US/docs/Web/CSS/attr
https://davidwalsh.name/css-content-attr

occupant’s picture

Patch is failing on 8.6.x-dev. Looks like it needs a reroll.

Agreed about the rule configuration @joelpittet outlines in #10 though.

occupant’s picture

Version: 8.5.x-dev » 8.6.x-dev
msankhala’s picture

Assigned: Unassigned » msankhala

Rerolling patch.

msankhala’s picture

Rerolled patch uploaded.

occupant’s picture

Status: Needs review » Reviewed & tested by the community

#14 applies cleanly, passed linting

[core] npm run lint:css                                              8.6.x  ✭ ✱

> Drupal@ lint:css /mypath/drupal/core
> stylelint "**/*.css" || exit 0

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

@joelpittet given we have no standards that means we need to create one. The stylelint default seems fine but we should go through the coding standards process - see https://www.drupal.org/project/coding_standards. We also need to update the coding standards pages for stylelint

joelpittet’s picture