Skip to content

Add support for theme-next.css CSS variable validation#33

Merged
origami-z merged 3 commits intomainfrom
claude/issue-25-dhi6G
Jan 24, 2026
Merged

Add support for theme-next.css CSS variable validation#33
origami-z merged 3 commits intomainfrom
claude/issue-25-dhi6G

Conversation

@origami-z
Copy link
Owner

Implements detection of SaltProviderNext usage and includes CSS variables
from theme-next.css when validating, preventing false errors for variables
defined in the newer theme configuration.

  • Add --themeNextCss CLI option to customize theme-next.css path
  • Detect SaltProviderNext imports in source files
  • Load and merge CSS variables from both index.css and theme-next.css
  • Works in both combined mode and CSS-only mode

Fixes #25

Implements detection of SaltProviderNext usage and includes CSS variables
from theme-next.css when validating, preventing false errors for variables
defined in the newer theme configuration.

- Add --themeNextCss CLI option to customize theme-next.css path
- Detect SaltProviderNext imports in source files
- Load and merge CSS variables from both index.css and theme-next.css
- Works in both combined mode and CSS-only mode

Fixes #25
- Create detectSaltProviderNext() helper function to eliminate code duplication
- Remove redundant console.log (verbose logging already happens in the helper)
- Reduce code from ~75 lines to ~30 lines with better maintainability
- Move detectSaltProviderNext function from index.js to migration/utils.js
- Add comprehensive unit tests covering all scenarios:
  - Detection from @salt-ds/core and @salt-ds/lab
  - Negative cases (no imports, wrong package, etc.)
  - Multiple files scenario
  - Empty source files array
- All 60 tests passing (added 7 new tests)
Copy link
Owner Author

@origami-z origami-z left a comment

Choose a reason for hiding this comment

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

LGTM

@origami-z origami-z merged commit 35ca1ad into main Jan 24, 2026
1 check passed
@origami-z origami-z deleted the claude/issue-25-dhi6G branch January 24, 2026 10:13
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.

Support CSS variable warning in theme-next.css

2 participants