Skip to content

fix: updateCSSVariable only for the same theme#345

Merged
Brentlok merged 1 commit intomainfrom
fix/updateCSSVariable
Jan 29, 2026
Merged

fix: updateCSSVariable only for the same theme#345
Brentlok merged 1 commit intomainfrom
fix/updateCSSVariable

Conversation

@Brentlok
Copy link
Copy Markdown
Contributor

@Brentlok Brentlok commented Jan 29, 2026

fixes #343

Summary by CodeRabbit

  • Bug Fixes
    • Fixed theme variable updates to only apply CSS variables for the currently active theme, preventing unintended global variable exposure from inactive themes.

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

This change fixes an inconsistency in updateCSSVariables by conditionally applying CSS variables only when the updated theme matches the current theme, preventing stale values from non-current themes overwriting the active theme's variables.

Changes

Cohort / File(s) Summary
CSS Variable Update Consistency Fix
packages/uniwind/src/core/config/config.native.ts, packages/uniwind/src/core/config/config.ts
Modified updateCSSVariables to guard CSS variable application with theme matching checks. Global CSS variables and applyCSSVariable invocations now only execute when the updated theme is the current theme, preserving the active theme's state and preventing cross-theme value leakage.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • jpudysz

Poem

🐰 A rabbit hops through theme-colored lands,
Where light and dark now dance in harmony,
No more confusion from careless hands—
Each theme respects its own decree,
Updates flow where they should be! 🌙✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 change: conditionally updating CSS variables only for the current theme instead of all themes.
Linked Issues check ✅ Passed The PR addresses the root cause of issue #343 by ensuring updateCSSVariables only applies to the current theme, preventing theme value corruption at app startup.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the updateCSSVariables inconsistency issue; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

@Brentlok Brentlok merged commit 41c167a into main Jan 29, 2026
2 checks passed
@Brentlok Brentlok deleted the fix/updateCSSVariable branch January 29, 2026 13:04
@coderabbitai coderabbitai bot mentioned this pull request Feb 20, 2026
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.

UpdateCSSVariables inconsistency

1 participant