Skip to content

Commit c964495

Browse files
authored
feat: add transparent variant to Button component (#595)
1 parent 695c93c commit c964495

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

.changeset/nice-walls-brake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tidbcloud/uikit": patch
3+
---
4+
5+
feat: add transparent variant to Button component

packages/uikit/src/theme/theme.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,12 +324,22 @@ const theme = createTheme({
324324
}
325325
}
326326

327+
const getTransparentStyles = () => {
328+
return {
329+
color: themeColor(theme, color, 7),
330+
'&:hover': {
331+
color: themeColor(theme, color, 7)
332+
}
333+
}
334+
}
335+
327336
const variantStyles = {
328337
filled: getFilledStyles(),
329338
light: getLightStyles(),
330339
default: getDefaultStyles(),
331340
subtle: getSubtleStyles(),
332-
outline: getDefaultStyles()
341+
outline: getDefaultStyles(),
342+
transparent: getTransparentStyles()
333343
}
334344

335345
const sizeStyles = {

stories/uikit/primitive/Button.stories.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,11 @@ export const DataDisabled: Story = {
249249
</Button>
250250
)
251251
}
252+
253+
export const Transparent = () => {
254+
return (
255+
<Button variant="transparent" color="peacock" leftSection={<IconSettings01 size={16} />}>
256+
Transparent
257+
</Button>
258+
)
259+
}

0 commit comments

Comments
 (0)