Skip to content

Preview/Stylelint#97

Open
andrescastellanos-coderabbit wants to merge 2 commits intomainfrom
Preview/Stylelint
Open

Preview/Stylelint#97
andrescastellanos-coderabbit wants to merge 2 commits intomainfrom
Preview/Stylelint

Conversation

@andrescastellanos-coderabbit
Copy link
Copy Markdown

@andrescastellanos-coderabbit andrescastellanos-coderabbit commented Apr 27, 2026

Screenshot 2026-04-27 at 1 18 41 PM

Demonstrates the Stylelint sandboxer tool. Three CSS/SCSS files (styles.css, components.scss, _layout.scss) for a demoapp design system, with intentionally embedded violations across 17+ rules: color-no-invalid-hex, property-no-unknown, unit-no-unknown, selector-type-no-unknown, block-no-empty, comment-no-empty, at-rule-no-unknown, function-no-unknown, declaration-block-no-shorthand-property-overrides (errors), and declaration-block-no-duplicate-properties, no-duplicate-selectors, length-zero-no-unit, shorthand-property-no-redundant-values, selector-max-id, selector-class-pattern, max-nesting-depth, font-family-name-quotes (warnings). Repo-level .stylelintrc.json at root with explicit per-rule severities — JSON only because .stylelintrc.js triggers the sandboxer's executable-config security skip (same gate that previously blocked ember-template-lint).

Summary by CodeRabbit

  • Style
    • Added new stylesheet files with CSS custom properties for consistent application-wide theming and color management
    • Introduced layout utility classes featuring responsive grid containers and flexbox display utilities
    • Added component-specific styling for product cards, page headers, navigation, call-to-action buttons, and alert notifications
    • Established base typography standards, spacing defaults, and foundational layout rules

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

Walkthrough

Three new stylesheet files are introduced: _layout.scss defines grid containers, padding, and column utilities; components.scss adds product card and price tag component styles with color variables; and styles.css establishes root CSS variables and applies base styling to layout elements and components.

Changes

Cohort / File(s) Summary
SCSS Stylesheets
stylelint/_layout.scss, stylelint/components.scss
Introduces layout primitives (grid container, flex utilities, column definitions) and component styling for product cards with nested sections, including intentional nonstandard @madeUpAtRule construct.
CSS Stylesheet
stylelint/styles.css
Establishes root CSS custom properties and applies base styling to header, body, buttons, alerts, and widgets; includes intentional unknown elements and nonstandard @unknownat at-rule.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 New styles hop into place,
Grids and colors embrace the space,
Layouts dance in SCSS grace,
Components paint the UI face,
This stylesheet sprint wins the race! 🎨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Preview/Stylelint' is vague and does not clearly describe the main changes; it reads more like a branch name than a meaningful summary of what the PR adds. Use a more descriptive title such as 'Add CSS/SCSS files with Stylelint violations for demo' or 'Add design system stylesheet files for Stylelint testing' to better communicate the PR's purpose.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch Preview/Stylelint

Comment @coderabbitai help to get the list of available commands and usage tips.

…rites its default extending stylelint-config-standard-scss (bare rules-only config without extends prevents the SCSS parser and plugin loading)
@andrescastellanos-coderabbit
Copy link
Copy Markdown
Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@stylelint/styles.css`:
- Around line 30-40: The fixtures are inert because .stylelintrc.json currently
disables selector-class-pattern, length-zero-no-unit, and
shorthand-property-no-redundant-values; either re-enable those rules in
.stylelintrc.json so the sandbox emits warnings, or update the CSS to follow the
rules: change invalid unit "100pixels" to a valid unit (e.g., "100px"), use "0"
instead of "0px" to trigger/comply with length-zero-no-unit, collapse the
four-value margin to a shorthand if redundant, and rename class selectors (e.g.,
.some_class and .cta_button) to match the selector-class-pattern (e.g.,
kebab-case like .some-class and .cta-button) so the intended warnings/fixtures
become active.
- Around line 10-16: The CSS uses invalid properties 'colour' and 'text-style'
but the sandbox won't flag them because ".stylelintrc.json" has
"property-no-unknown": null; either enable the rule by setting
"property-no-unknown": true in .stylelintrc.json (so the linter will report
'colour' and 'text-style') or change the fixture to use valid/intentional
unknown examples (e.g., keep 'colour' and 'text-style' as-is) while leaving the
rule enabled; update the configuration or the declarations accordingly so the
intended rule is actually exercised.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 9bb16879-7639-4bb2-8adb-ad82f0ff8927

📥 Commits

Reviewing files that changed from the base of the PR and between ef04b8d and de07b77.

📒 Files selected for processing (3)
  • stylelint/_layout.scss
  • stylelint/components.scss
  • stylelint/styles.css

Comment thread stylelint/styles.css
Comment on lines +10 to +16
body {
colour: #ffffff;
background: var(--primary);
text-style: bold;
margin: 0px;
padding: 0;
font-family: Arial Black, sans-serif;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

These declarations won't exercise property-no-unknown as written.

Line 11 (colour) and Line 13 (text-style) look like the property-no-unknown fixture, but .stylelintrc.json:1-37 sets "property-no-unknown": null, so the sandbox will not report either one. If this PR is meant to showcase that rule, the config or fixture needs to change.

🧰 Tools
🪛 Stylelint (17.9.0)

[error] 16-16: Expected quotes around "Arial Black" (font-family-name-quotes)

(font-family-name-quotes)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@stylelint/styles.css` around lines 10 - 16, The CSS uses invalid properties
'colour' and 'text-style' but the sandbox won't flag them because
".stylelintrc.json" has "property-no-unknown": null; either enable the rule by
setting "property-no-unknown": true in .stylelintrc.json (so the linter will
report 'colour' and 'text-style') or change the fixture to use valid/intentional
unknown examples (e.g., keep 'colour' and 'text-style' as-is) while leaving the
rule enabled; update the configuration or the declarations accordingly so the
intended rule is actually exercised.

Comment thread stylelint/styles.css
Comment on lines +30 to +40
.some_class {
width: 100pixels;
height: 0px;
margin: 5px 5px 5px 5px;
}

.cta_button {
background: var(--accent);
color: #ffffff;
padding: 8px 12px;
border-radius: 4px;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Several advertised warning fixtures are currently inert.

.stylelintrc.json:1-37 disables "selector-class-pattern", "length-zero-no-unit", and "shorthand-property-no-redundant-values", so Line 30 (.some_class), Line 32 (0px), Line 33 (four-value margin), and Line 36 (.cta_button) will not produce those warnings in the sandbox.

🧰 Tools
🪛 Stylelint (17.9.0)

[error] 31-31: Unknown unit "pixels" (unit-no-unknown)

(unit-no-unknown)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@stylelint/styles.css` around lines 30 - 40, The fixtures are inert because
.stylelintrc.json currently disables selector-class-pattern,
length-zero-no-unit, and shorthand-property-no-redundant-values; either
re-enable those rules in .stylelintrc.json so the sandbox emits warnings, or
update the CSS to follow the rules: change invalid unit "100pixels" to a valid
unit (e.g., "100px"), use "0" instead of "0px" to trigger/comply with
length-zero-no-unit, collapse the four-value margin to a shorthand if redundant,
and rename class selectors (e.g., .some_class and .cta_button) to match the
selector-class-pattern (e.g., kebab-case like .some-class and .cta-button) so
the intended warnings/fixtures become active.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant