Skip to content

Commit 781940a

Browse files
committed
WIP
1 parent 0555d1f commit 781940a

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

src/components/Button/Button.tsx

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,20 @@ const StyledButton = styled(BaseButton)<{
115115
${({ $loading, $styleType, theme }) => {
116116
if (!$loading) return "";
117117
118+
// Create dynamic shimmer gradient using the button's background colors
119+
const bgDefault = "rgba(255, 255, 255, 0)";
120+
const bgHover = theme.click.button.basic.color[$styleType].background.hover;
121+
122+
const shimmerGradient = `linear-gradient(
123+
90deg,
124+
${bgHover} 0%,
125+
${theme.global.color.background.default} 50%,
126+
${bgHover} 100%
127+
)`;
128+
118129
return css`
119130
&::before {
120-
background-image: ${theme.click.button.basic.color[$styleType].background
121-
.loading};
131+
background: ${shimmerGradient} 0% 0% / 50% 100% no-repeat;
122132
animation: ${shimmer} 1.5s ease-in-out infinite;
123133
opacity: 1;
124134
}
@@ -176,20 +186,29 @@ const StyledButton = styled(BaseButton)<{
176186
if ($styleType === "primary") {
177187
// Primary: 60% opacity + shimmer animation
178188
return css`
179-
opacity: 0.6;
180189
cursor: not-allowed;
190+
191+
&::before {
192+
opacity: 0.6;
193+
}
181194
`;
182195
} else if ($styleType === "secondary" || $styleType === "empty") {
183196
// Secondary & Empty: Full opacity during loading, shimmer only, text dimmed (70%)
184197
return css`
185-
opacity: 0.7;
186198
cursor: not-allowed;
199+
200+
&::before {
201+
opacity: 0.7;
202+
}
187203
`;
188204
} else if ($styleType === "danger") {
189205
// Destructive: Full opacity during loading, shimmer only, text dimmed (70%)
190206
return css`
191-
opacity: 0.7;
192207
cursor: not-allowed;
208+
209+
&::before {
210+
opacity: 0.7;
211+
}
193212
`;
194213
}
195214

0 commit comments

Comments
 (0)