Skip to content

Internal: Fix stylelint errors [TMZ-1046]#668

Merged
rami-elementor merged 1 commit into
mainfrom
TMZ-1046-fix-stylelint-errors
Jun 22, 2026
Merged

Internal: Fix stylelint errors [TMZ-1046]#668
rami-elementor merged 1 commit into
mainfrom
TMZ-1046-fix-stylelint-errors

Conversation

@rami-elementor

@rami-elementor rami-elementor commented Jun 21, 2026

Copy link
Copy Markdown
Member
image

✨ PR Description

1. Problem & Context

Automated stylelint fixes for SCSS codebase compliance. Changes primarily normalize pseudo-element syntax (:before::before), color values to shorthand, font-weight keywords to numeric values, and add missing stylelint directives.

2. What Changed (Where)

File Changes
dev/scss/customizer.scss Pseudo-element syntax, color value normalization, font-weight keyword → numeric
dev/scss/editor-styles.scss Removed duplicate selector block
dev/scss/reset/ (_forms.scss, _reset.scss, _table.scss) Color/font-weight normalization, pseudo-element syntax, monospace font duplication removed
dev/scss/reset/_variables.scss Color hex shorthand, added stylelint disable directive
dev/scss/theme/ (_comments.scss, _footer.scss, _general.scss, _header.scss, _layout.scss, _navigation.scss) Pseudo-element syntax, attribute selector quotes, whitespace/comment normalization
.stylelintrc Added postcss-scss plugin and disabled specificity rule

3. How It Works

Stylelint rules applied mechanically across all SCSS files: pseudo-elements converted to :: syntax per CSS spec, color values simplified (#ffffff#fff, white#fff), keyword font-weights changed to numeric (400/700), and redundant monospace declarations removed. Config updated to support SCSS parsing and suppress false positives on specificity.

4. Risks

Minimal—purely stylistic/linting compliance changes with no functional impact. Color/font-weight conversions are semantically equivalent. Potential edge case: older browsers don't recognize :: pseudo-elements, but codebase already assumes modern browser support. Verify no build pipeline relies on the removed duplicate selector structure.

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how


pre {
font-family: monospace, monospace; /* 1 */
font-family: monospace; /* 1 */

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are declaring twice the same font monospace.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to study this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is nothing to study, the font-family property accepts a list of font names separated by commas.

In this case it was a list of two names. Both list items use the same font. The lint found this issue. We fixed it.

Comment on lines -28 to -34
code,
kbd,
pre,
samp {
font-size: variables.$font-size-base;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate. The next 7 lines declare the same rules again.

Comment thread dev/scss/reset/_variables.scss
$success-color: $green !default;

//Fonts
/* stylelint-disable value-keyword-case */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason of this change?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer not to replace Arial with arial, Roboto with roboto etc.

Keeping font names as they are, we avoid breaking changes.

&::before,
&::after {
content: '';
background-color: currentColor;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting.

I will study this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the correct keyword is currentColor, not currentcolor (mdn). But I wanted to finish the PR, so I updated based on the lint suggestion.

I could change the rule, but I didn't do that.

Comment thread dev/scss/customizer.scss
Comment thread .stylelintrc
Comment thread .stylelintrc
"plugins": ["stylelint-scss"],
"rules": {
"at-rule-no-unknown": null,
"no-descending-specificity": null,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we adding this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This no-descending-specificity rule flags when a more specific CSS selector appears before a less specific one.

If we implement this, we will have to reorder many of our CSS rules. I prefer not to do this, to reduce risk and to avoid accidental breaking changes.

Comment thread dev/scss/reset/_forms.scss
@rami-elementor rami-elementor merged commit 3ba3f28 into main Jun 22, 2026
29 checks passed
@rami-elementor rami-elementor deleted the TMZ-1046-fix-stylelint-errors branch June 22, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants