Create a coding standard for CSS to ensure whitespace after function calls

Created on 14 February 2018, over 7 years ago
Updated 27 June 2025, 13 days ago

Problem/Motivation

Created from this issue 📌 Update stylelint rule function-whitespace-after to be consistent with Drupal's CSS standards Postponed applying the rule. And this being the rule:
https://stylelint.io/user-guide/rules/function-whitespace-after/

And my own confusion because it's not clear cut in the CSS spec on how to do concatenation of strings with the content property.
https://github.com/stylelint/stylelint/issues/3145

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

Proposed resolution

Ensure spaces around functions are enforced and follow the default stylelint standard.

Example diff:

-  content: " ("attr(lang)")";
+  content: " (" attr(lang) ")";

Remaining tasks

Discuss and Agree

📌 Task
Status

Closed: outdated

Component

Coding Standards

Created by

🇨🇦Canada joelpittet Vancouver

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024