fix(button,select): match transition timing and remove theme-change flicker#830
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR configures theme transition behavior and refines component CSS to respect user motion preferences. The app-level theme providers now disable transitions during theme changes via the Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
Description
Fixes the visible flicker on Button and Select Trigger when switching themes.
Two mismatches and one structural issue were causing it:
transition: all 0.2s ease-in-outwhile Select Trigger usedall 0.2s ease, so their colors interpolated at different rates during a theme flip. Button now usesease, matching Select Trigger and the--rs-transition-interactivetoken convention.@media (prefers-reduced-motion: no-preference)but Select Trigger's was not, so with OS-level Reduce Motion enabled the Button snapped while the Trigger faded. Select Trigger's transition is now gated identically.outline/ghostvariants, whose background is the same variable as the page background). CSS cannot distinguish theme-driven variable changes from hover-driven ones, so the docs app now passesdisableTransitionOnChangeto both the next-themes and Apsara theme providers — transitions are suppressed only for the frame the theme attribute flips; hover/press animations are unaffected.Out of scope carving out
--rs-duration-*/--rs-easing-*tokens and migrating the remaining ad-hoc transitions (text area, field, filter-chip).Note for consumers: product apps using Apsara's
ThemeProviderdirectly should also passdisableTransitionOnChangeto get the same fix; defaulting it totruein the library is a follow-up decision.Type of Change
How Has This Been Tested?
@raystack/apsaraand ran the docs app locallytransitiondeclarations acrosspackages/raystack/components/**/*.module.cssto confirm Button and Select Trigger are now byte-identical in transition behavior.Checklist:
Screenshots (if appropriate):
N/A
Related Issues
N/A