Skip to content

Commit

Permalink
feat(Button): add ghost button
Browse files Browse the repository at this point in the history
- `--xc-button-border-radius: 0.25em`
  • Loading branch information
jsonleex committed Sep 8, 2023
1 parent ca3e0ed commit 2981091
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 1 deletion.
8 changes: 7 additions & 1 deletion components/button/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
--xc-button-background-color-hover: var(--xc-c-background-hover);
--xc-button-background-color-active: var(--xc-c-background-active);
--xc-button-background-color-disabled: var(--xc-c-background-disabled);
--xc-button-border-radius: 0;
--xc-button-border-radius: .25em;

position: relative;
display: inline-flex;
Expand Down Expand Up @@ -189,4 +189,10 @@

.x-button>.iconify:only-child {
margin: 0 -0.25em;
}

.x-button-ghost {
color: var(--xc-c-text-inverse);
background-color: transparent;
border-color: transparent;
}
2 changes: 2 additions & 0 deletions components/button/button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface ButtonProps {
loading?: boolean
rounded?: boolean
outlined?: boolean
ghost?: boolean
color?: ButtonColor
}
Expand All @@ -24,6 +25,7 @@ withDefaults(defineProps<ButtonProps>(), {
loading && 'x-button-loading',
outlined && 'x-button-outlined',
rounded && 'x-button-rounded',
ghost && 'x-button-ghost',
]"
>
<slot />
Expand Down
3 changes: 3 additions & 0 deletions components/button/demos/0.basic-useage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ import { Button, Flex } from '@leex/components'
<Button rounded>
<span>rounded</span>
</Button>
<Button ghost>
<span>ghost</span>
</Button>
</Flex>
</template>
8 changes: 8 additions & 0 deletions components/button/demos/1.colored.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@ const colors: ButtonColor[] = ['primary', 'secondary', 'success', 'danger', 'war
<span>{{ color }}</span>
</Button>
</Flex>
<Flex>
<Button
v-for="color in colors" :key="color" :color="color"
ghost
>
<span>{{ color }}</span>
</Button>
</Flex>
</template>
9 changes: 9 additions & 0 deletions components/button/demos/2.outlined.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,13 @@ const colors: ButtonColor[] = ['primary', 'secondary', 'success', 'danger', 'war
<span>{{ color }}</span>
</Button>
</Flex>
<Flex>
<Button
v-for="color in colors" :key="color" :color="color"
ghost
outlined
>
<span>{{ color }}</span>
</Button>
</Flex>
</template>
3 changes: 3 additions & 0 deletions components/button/demos/4.with-icons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ import { Button, Flex, Icon } from '@leex/components'
<Button rounded>
<Icon icon="ri:search-line" />
</Button>
<Button rounded ghost>
<Icon icon="ri:search-line" />
</Button>
</Flex>
</template>

0 comments on commit 2981091

Please # to comment.