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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

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

Version: 8.6.x-dev » 8.7.x-dev

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

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

_utsavsharma’s picture

Reroll for 8.7.x

longwave’s picture

Issue tags: +Needs reroll

This needs reroll for 10.1.x.

_utsavsharma’s picture

Patch for 10.1.x.

Nikhil_110’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work

#29 needs a reroll.

Tanuj.’s picture

Adding a reroll patch for #29.

Tanuj.’s picture

Assigned: msankhala » Unassigned
Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs reroll +Needs Review Queue Initiative

#32 applies now.

catch’s picture

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

As far as I can tell this is still blocked on #16/#17 and #2944596: Create a coding standard for CSS to ensure whitespace after function calls.

Marking postponed, but also needs an issue summary update. If we want to commit it before the standard is in place (which I can see doing since it's just a single example in core), that should also be documented in the issue summary.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.