Skip to content

Conversation

@alessandrobellesia
Copy link
Member

@alessandrobellesia alessandrobellesia commented Dec 30, 2025

Add $zero-specificity parameter to theme mixins with :where() wrapping Rename $props to $use-custom-props across all mixins for consistency Update spread-map-into-attrs mixin to use $use-custom-props parameter Update all mixin calls in components and theme files Remove obsolete $props parameter from spread-map-into-bem mixin

Summary by CodeRabbit

  • New Features

    • Global utility refManualReset added and exposed with TypeScript support.
  • Chores

    • Standardized theme/mixin parameters for custom-props handling and introduced optional zero-specificity selector mode.
    • Reordered package export mappings (no API removals).
    • Minor style tweak: dialogs now allow text selection.

✏️ Tip: You can customize this high-level summary in your review settings.

Add $zero-specificity parameter to theme mixins with :where() wrapping
Rename $props to $use-custom-props across all mixins for consistency
Update spread-map-into-attrs mixin to use $use-custom-props parameter
Update all mixin calls in components and theme files
Remove obsolete $props parameter from spread-map-into-bem mixin
@coderabbitai
Copy link

coderabbitai bot commented Dec 30, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR renames an SCSS mixin parameter from $props to $use-custom-props across mixins and ~30 component stylesheets, adds a $zero-specificity parameter to theme mixins to optionally wrap selectors with :where(), and augments TypeScript/ESLint config to expose refManualReset.

Changes

Cohort / File(s) Summary
Type definitions
\.eslintrc-auto-import.json``, auto-imports.d.ts
Added global refManualReset to ESLint auto-imports and to TS global / Vue ComponentCustomProperties declarations.
Package manifest
package.json
Reordered export mappings for design-token ./props/* and ./scss/props/* entries within exports (moved location; paths unchanged).
Mixin core — BEM & attrs
src/tools/mixin-modules/_bem.scss, src/tools/mixin-modules/_attrs.scss
Renamed public parameter $props$use-custom-props (default true) across spread-map-into-* and spread-map-into-attrs, updated internals, calls, and conditionals.
Theme mixins
src/tools/mixin-modules/_theme.scss
Added $zero-specificity: true to spread-theme-component and internal helpers; propagate flag; conditionally wrap selectors with :where(); added @use 'helpers' as *;.
Component styles (call-site updates)
Components (many)
src/components/.../vv-*.scss (e.g., vv-accordion.scss, vv-button.scss, vv-select.scss, etc.)
Updated spread-map-into-bem calls to pass $use-custom-props: $use-custom-props-for-components instead of $props: .... vv-button.scss also updates spread-map-into-attrs call.
Dark theme component calls
src/themes/dark/components/_vv-*.scss (e.g., _vv-alert.scss, _vv-select.scss, _vv-button.scss, etc.)
Extended spread-theme-component invocations to include $zero-specificity: $zero-specificity-for-components (added trailing commas where needed).
Settings update
src/settings/components/_vv-dialog.scss
Added user-select: text to $vv-dialog component map.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 A hop, a tweak, a tiny rename,
From $props to $use-custom-props the same,
:where() wraps with zero weight and cheer,
Thirty files nod as changes appear,
I nibble code crumbs and celebrate here! 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding zero-specificity support and standardizing mixin parameters from $props to $use-custom-props across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1f5ccc2 and f76ac5c.

📒 Files selected for processing (1)
  • src/settings/components/_vv-dialog.scss

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@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: 0

🧹 Nitpick comments (1)
src/tools/mixin-modules/_bem.scss (1)

41-59: Clarify the distinction between $custom-props and $use-custom-props parameters.

The mixin has both $use-custom-props (line 49) and $custom-props (line 51). While they serve different purposes—$use-custom-props controls CSS custom property generation and $custom-props is a flag to skip the props section—the naming similarity could cause confusion for consumers.

Consider adding a brief inline comment or updating the docblock to clarify the distinction, especially since the PR's goal is to standardize naming.

🔎 Suggested documentation improvement
 // @param {Bool} $use-custom-props - Whether to use CSS custom properties
 // @param {Bool} $zero-specificity - Whether to wrap in :where()
-// @param {Bool} $custom-* - Flags to skip specific parts
+// @param {Bool} $custom-props - Skip auto-generating :root custom properties block
+// @param {Bool} $custom-block - Skip auto-generating the block selector
+// @param {Bool} $custom-elements - Skip auto-generating element selectors
+// @param {Bool} $custom-modifiers - Skip auto-generating modifier selectors
+// @param {Bool} $custom-states - Skip auto-generating state selectors
+// @param {Bool} $custom-breakpoints - Skip auto-generating breakpoint rules
+// @param {Bool} $custom-transitions - Skip auto-generating transition rules
 // @param {Map} $bps - Breakpoints map
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 39ccb5c and 1f5ccc2.

📒 Files selected for processing (45)
  • .eslintrc-auto-import.json
  • auto-imports.d.ts
  • package.json
  • src/components/vv-accordion-group.scss
  • src/components/vv-accordion.scss
  • src/components/vv-alert-group.scss
  • src/components/vv-alert.scss
  • src/components/vv-avatar-group.scss
  • src/components/vv-avatar.scss
  • src/components/vv-badge.scss
  • src/components/vv-breadcrumb.scss
  • src/components/vv-button-group.scss
  • src/components/vv-button.scss
  • src/components/vv-card.scss
  • src/components/vv-checkbox-group.scss
  • src/components/vv-checkbox.scss
  • src/components/vv-dialog.scss
  • src/components/vv-dropdown-action.scss
  • src/components/vv-dropdown-optgroup.scss
  • src/components/vv-dropdown-option.scss
  • src/components/vv-dropdown.scss
  • src/components/vv-input-file.scss
  • src/components/vv-input-text.scss
  • src/components/vv-nav.scss
  • src/components/vv-progress.scss
  • src/components/vv-radio-group.scss
  • src/components/vv-radio.scss
  • src/components/vv-select.scss
  • src/components/vv-skeleton.scss
  • src/components/vv-tab.scss
  • src/components/vv-table.scss
  • src/components/vv-text.scss
  • src/components/vv-textarea.scss
  • src/components/vv-tooltip.scss
  • src/themes/dark/components/_vv-alert.scss
  • src/themes/dark/components/_vv-avatar.scss
  • src/themes/dark/components/_vv-badge.scss
  • src/themes/dark/components/_vv-button.scss
  • src/themes/dark/components/_vv-dropdown-action.scss
  • src/themes/dark/components/_vv-dropdown-option.scss
  • src/themes/dark/components/_vv-nav.scss
  • src/themes/dark/components/_vv-select.scss
  • src/tools/mixin-modules/_attrs.scss
  • src/tools/mixin-modules/_bem.scss
  • src/tools/mixin-modules/_theme.scss
🔇 Additional comments (58)
src/components/vv-breadcrumb.scss (1)

8-14: LGTM! Parameter rename is correct.

The parameter rename from $props to $use-custom-props aligns with the PR's goal of standardizing mixin parameter naming across the codebase. The value passed remains unchanged, ensuring no behavioral impact.

src/tools/mixin-modules/_attrs.scss (4)

67-77: LGTM! Mixin signature and documentation updated correctly.

The parameter rename from $props to $use-custom-props is properly reflected in both the documentation comment and the function signature. The default value remains true, preserving backward compatibility.


110-118: LGTM! Recursive call updated correctly.

The recursive call to spread-map-into-attrs within the pseudo-element handler correctly propagates the renamed $use-custom-props parameter.


124-132: LGTM! Recursive call updated correctly.

The recursive call to spread-map-into-attrs correctly uses the renamed $use-custom-props parameter.


135-139: LGTM! Conditional logic updated correctly.

The conditional that gates custom property generation now correctly references the renamed $use-custom-props parameter, maintaining the original logic.

src/components/vv-skeleton.scss (1)

9-15: LGTM! Parameter rename is correct.

The parameter rename from $props to $use-custom-props is consistent with the standardization effort across all component files.

src/components/vv-avatar-group.scss (1)

8-14: LGTM! Parameter rename is correct.

The parameter rename from $props to $use-custom-props is consistent with the standardization effort across the codebase.

.eslintrc-auto-import.json (1)

102-102: LGTM! VueUse auto-import addition is correct.

The addition of refManualReset global follows the established pattern for other VueUse ref utilities and is properly positioned in alphabetical order.

src/components/vv-radio-group.scss (1)

8-14: LGTM! Parameter rename is correct.

The parameter rename from $props to $use-custom-props is consistent with the standardization effort.

src/components/vv-dropdown-action.scss (1)

8-14: LGTM! Parameter rename is correct.

The parameter rename from $props to $use-custom-props is consistent with the standardization effort across all component files.

src/components/vv-checkbox-group.scss (1)

8-14: LGTM! Parameter rename is correct.

The parameter rename from $props to $use-custom-props is consistent with the standardization effort across the codebase.

src/components/vv-dropdown.scss (1)

8-14: LGTM! Consistent parameter rename.

The parameter rename is correct and consistent with the standardization effort.

src/components/vv-tooltip.scss (1)

9-15: LGTM! Consistent parameter rename.

The parameter rename is correct and aligns with the standardization effort.

src/components/vv-radio.scss (1)

9-15: LGTM! Consistent parameter rename.

The parameter rename is correct and consistent with the codebase standardization.

src/components/vv-dropdown-option.scss (1)

8-14: LGTM! Consistent parameter rename.

The parameter rename is correct and aligns with the broader refactoring effort.

src/components/vv-button-group.scss (1)

11-17: LGTM! Consistent parameter rename.

The parameter rename is correct and consistent with the standardization objectives.

src/components/vv-card.scss (1)

8-14: LGTM! Consistent parameter rename.

The parameter rename is correct and aligns with the codebase-wide standardization.

src/components/vv-badge.scss (1)

8-14: LGTM! Consistent parameter rename.

The parameter rename is correct and completes the standardization effort for this file.

src/components/vv-table.scss (1)

8-14: Parameter rename is correctly and consistently applied across the codebase.

All spread-map-into-bem call sites and the mixin definition itself have been updated to use $use-custom-props. No instances of the old $props parameter remain. The mixin and all nested calls (elements, modifiers, states, breakpoints, transitions, and attributes) properly pass the parameter through, confirming consistent implementation across all 30+ affected component files.

src/components/vv-alert-group.scss (1)

8-14: LGTM! Parameter renaming is consistent.

The parameter rename from $props to $use-custom-props aligns with the PR's standardization objective. The passed value and overall logic remain unchanged.

src/components/vv-dialog.scss (1)

8-14: LGTM! Consistent parameter standardization.

The parameter rename is correctly applied and maintains the same value, consistent with the broader refactoring effort.

src/components/vv-alert.scss (1)

8-14: LGTM! Parameter rename applied correctly.

The mixin invocation has been updated with the standardized parameter name while preserving the original value.

src/themes/dark/components/_vv-badge.scss (1)

7-14: LGTM! Zero-specificity parameter added correctly.

The addition of the $zero-specificity parameter to the theme mixin enables zero-specificity support as intended. The trailing comma formatting is appropriate for multi-line argument lists.

src/themes/dark/components/_vv-dropdown-action.scss (1)

7-14: LGTM! Consistent zero-specificity addition.

The zero-specificity parameter is properly threaded through the theme component mixin, consistent with the pattern applied across other dark theme components.

src/components/vv-input-file.scss (1)

10-16: LGTM! Parameter standardization applied correctly.

The parameter rename is correctly applied. I also note that $zero-specificity-for-components is already being used consistently throughout this file in the wrap-with-where calls (lines 24, 48, 68, 90), which shows proper integration of the zero-specificity feature.

src/components/vv-avatar.scss (1)

8-14: LGTM! Clean parameter rename.

The parameter standardization is correctly applied, maintaining consistency with the broader refactoring effort across all component files.

src/components/vv-accordion-group.scss (1)

8-14: Parameter refactoring verified across all call sites.

All 32 spread-map-into-bem calls consistently use the standardized parameters ($map, $block, $use-custom-props, $zero-specificity, $bps) with no remnants of the old $props parameter. All 9 spread-theme-component calls in the theme modules include the $zero-specificity parameter. The mechanical refactoring is complete and uniformly applied.

src/components/vv-input-text.scss (1)

13-13: LGTM! Parameter rename applied correctly.

The parameter rename from $props to $use-custom-props is consistent with the standardization effort described in the PR objectives.

auto-imports.d.ts (1)

91-91: Verify the inclusion of refManualReset in this PR.

The addition of refManualReset from @vueuse/core is technically correct and follows the established pattern. However, this TypeScript change appears unrelated to the SCSS parameter standardization described in the PR objectives. Can you confirm this was intentionally included in this PR?

Also applies to: 400-400

src/themes/dark/components/_vv-button.scss (1)

12-13: LGTM! Zero-specificity parameter added correctly.

The addition of the $zero-specificity parameter to the spread-theme-component mixin is consistent with the PR objectives and follows the established pattern.

src/themes/dark/components/_vv-nav.scss (1)

12-13: LGTM! Zero-specificity parameter added correctly.

The addition of the $zero-specificity parameter is consistent with the PR objectives and maintains uniformity across theme components.

src/themes/dark/components/_vv-dropdown-option.scss (1)

12-13: LGTM! Zero-specificity parameter added correctly.

The changes are consistent with the zero-specificity support being added across all theme components.

src/components/vv-tab.scss (1)

11-11: LGTM! Parameter rename applied correctly.

The parameter rename from $props to $use-custom-props is consistent with the standardization effort across all components.

src/themes/dark/components/_vv-avatar.scss (1)

12-13: LGTM! Zero-specificity parameter added correctly.

The changes align with the zero-specificity support being rolled out across theme components.

src/themes/dark/components/_vv-alert.scss (1)

12-13: LGTM! Zero-specificity parameter added correctly.

The addition of the $zero-specificity parameter completes the consistent implementation across all reviewed theme components.

src/components/vv-progress.scss (1)

8-14: LGTM!

Consistent parameter rename from $props to $use-custom-props.

src/components/vv-checkbox.scss (1)

9-15: LGTM!

Consistent parameter rename from $props to $use-custom-props.

src/components/vv-accordion.scss (1)

8-14: LGTM!

Consistent parameter rename from $props to $use-custom-props.

src/components/vv-textarea.scss (1)

10-16: LGTM!

Consistent parameter rename from $props to $use-custom-props.

src/components/vv-nav.scss (1)

8-14: LGTM!

Consistent parameter rename from $props to $use-custom-props.

src/components/vv-select.scss (1)

10-16: LGTM!

Consistent parameter rename from $props to $use-custom-props.

src/themes/dark/components/_vv-select.scss (1)

7-14: Zero-specificity parameter implementation is correct.

The $zero-specificity parameter is properly supported in the spread-theme-component mixin definition (src/tools/mixin-modules/_theme.scss) with a default value of true. The mixin call in this file correctly passes the parameter, aligning with the PR objectives for zero-specificity rule support in theme mixins.

src/components/vv-text.scss (1)

8-14: Parameter rename is complete across all call sites.

Verification confirms that all calls to spread-map-into-bem throughout the codebase have been successfully updated from $props to $use-custom-props. No instances of the old parameter name remain.

src/components/vv-dropdown-optgroup.scss (1)

8-14: LGTM!

The parameter rename from $props to $use-custom-props aligns with the standardized mixin signature, and the $zero-specificity parameter is correctly passed through.

src/components/vv-button.scss (1)

9-34: LGTM!

Both spread-map-into-bem and spread-map-into-attrs calls correctly use the renamed $use-custom-props parameter. The custom block pattern with wrap-with-where properly leverages the zero-specificity feature.

src/tools/mixin-modules/_bem.scss (5)

176-278: LGTM!

The spread-map-into-modifiers mixin correctly propagates $use-custom-props through all internal calls to spread-map-into-attrs, spread-map-into-elements, spread-map-into-states, and recursive spread-map-into-modifiers calls.


284-391: LGTM!

The spread-map-into-elements mixin properly passes $use-custom-props to spread-map-into-attrs, spread-map-into-states, and spread-map-into-breakpoints.


397-492: LGTM!

The spread-map-into-states mixin correctly handles $use-custom-props propagation through all internal mixin calls.


580-667: LGTM!

The spread-map-into-breakpoints mixin properly propagates $use-custom-props through all breakpoint operator branches (up, down, between).


673-750: LGTM!

The spread-map-into-transitions mixin correctly passes $use-custom-props to spread-map-into-attrs, spread-map-into-elements, and spread-map-into-breakpoints.

package.json (1)

208-235: LGTM!

The props export mappings have been relocated within the exports object for better organization. The public API surface remains unchanged—only the declaration order has been adjusted to group props exports after components.

src/tools/mixin-modules/_theme.scss (7)

6-6: LGTM!

The @use 'helpers' as *; import is required for the wrap-with-where mixin used throughout this file for zero-specificity wrapping.


59-68: LGTM!

The spread-theme-component mixin signature correctly adds $zero-specificity: true as a new parameter with a sensible default that maintains backward compatibility.


97-104: LGTM!

Block styles are now conditionally wrapped with :where() based on the $zero-specificity flag, enabling zero-specificity rules when enabled.


156-200: LGTM!

The _theme-generate-all helper correctly propagates $zero-specificity to all nested calls (_theme-spread-modifiers, _theme-spread-elements, _theme-spread-states) and uses wrap-with-where for the block selector.


207-261: LGTM!

The _theme-spread-modifiers mixin properly propagates $zero-specificity through all recursive and nested calls, ensuring consistent zero-specificity behavior for modifier, state, and element rules.


264-295: LGTM!

The _theme-spread-elements mixin correctly handles $zero-specificity propagation for element selectors and nested state calls.


298-373: LGTM!

The _theme-spread-states mixin comprehensively applies wrap-with-where to all state selector variants (BEM modifier style, class style, attribute-based, and pseudo-class style), ensuring consistent zero-specificity behavior across all state representations.

@sonarqubecloud
Copy link

@alessandrobellesia alessandrobellesia merged commit c4ca29e into develop Dec 30, 2025
10 of 11 checks passed
@alessandrobellesia alessandrobellesia deleted the feature/fix-zero-specificity-for-themes branch December 30, 2025 16:46
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.

2 participants