This repository was archived by the owner on Jul 31, 2026. It is now read-only.
fix: the rainbow - #307
Merged
Merged
Conversation
farazcsk
reviewed
Oct 7, 2025
adaam2
force-pushed
the
fix/the-rainbow
branch
from
October 20, 2025 13:09
bf64853 to
3e18b8c
Compare
farazcsk
approved these changes
Oct 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Rainbow Button Z-Index Issues in Stacking Contexts
Problem
The rainbow/brand variant of the Button component was experiencing z-index issues in certain stacking contexts, causing the gradient background to appear behind other elements or not display correctly. This was due to the use of CSS pseudo-elements (
::beforeand::after) for the gradient background, which created stacking context problems.Root Cause
The original implementation used CSS pseudo-elements for the brand variant's gradient background:
Pseudo-elements create their own stacking contexts and can be affected by the parent element's z-index, transform, opacity, and other CSS properties that create new stacking contexts. This caused the gradient to appear behind other elements in complex layouts.
Solution
Replaced the pseudo-element approach with actual child elements to avoid stacking context issues:
Key Changes
<span>element instead of::beforepseudo-elementz-10, content span hasz-20flex items-center justify-centerto the content span to preserve icon alignmentasChildis trueWhy This Works