koel/resources/assets/js/components/ui/Btn.vue

82 lines
1.2 KiB
Vue
Raw Normal View History

2022-04-15 14:24:30 +00:00
<template>
2023-08-20 22:35:58 +00:00
<button ref="button">
2022-04-15 14:24:30 +00:00
<slot>Click me</slot>
</button>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const button = ref<HTMLButtonElement>()
defineExpose({
button
})
</script>
2022-04-15 14:24:30 +00:00
<style lang="scss" scoped>
button {
background: var(--color-blue);
color: var(--color-text-primary);
font-size: 1rem;
padding: .6rem .85rem;
2022-04-15 14:24:30 +00:00
cursor: pointer;
2022-07-15 07:23:55 +00:00
display: inline-flex;
align-items: center;
2022-07-16 09:52:39 +00:00
justify-content: center;
2022-07-15 07:23:55 +00:00
gap: .3rem;
2022-04-15 14:24:30 +00:00
2023-08-20 22:35:58 +00:00
&:not([disabled]):hover {
2022-04-15 14:24:30 +00:00
box-shadow: inset 0 0 0 10rem rgba(0, 0, 0, .05);
}
&[big] {
padding: .85rem 1.4rem;
}
2022-04-15 14:24:30 +00:00
&[small] {
font-size: .9rem;
padding: .4rem .7rem;
2022-04-15 14:24:30 +00:00
}
@include inset-when-pressed();
&[green] {
background-color: var(--color-green);
}
&[white] {
background-color: transparent;
color: var(--color-text-secondary);
}
&[red] {
background-color: var(--color-red);
}
&[grey], &[gray] {
background-color: var(--color-bg-secondary);
}
&[orange] {
background-color: var(--color-highlight);
}
&[transparent] {
background-color: transparent;
}
&[rounded] {
border-radius: 999px;
}
&[unrounded] {
border-radius: 0 !important;
2022-04-15 14:24:30 +00:00
}
&[uppercase] {
text-transform: uppercase;
}
}
</style>