koel/resources/assets/js/components/ui/btn-group.vue

46 lines
850 B
Vue
Raw Normal View History

2022-04-15 14:24:30 +00:00
<template>
<span class="btn-group">
<slot>
2022-04-15 17:00:08 +00:00
<Btn green>Foo</Btn>
<Btn orange>Bar</Btn>
<Btn red>Baz</Btn>
2022-04-15 14:24:30 +00:00
</slot>
</span>
</template>
2022-04-15 17:00:08 +00:00
<script lang="ts" setup>
import { defineAsyncComponent } from 'vue'
2022-04-15 14:24:30 +00:00
2022-04-15 17:00:08 +00:00
const Btn = defineAsyncComponent(() => import('@/components/ui/btn.vue'))
2022-04-15 14:24:30 +00:00
</script>
<style lang="scss" scoped>
.btn-group {
display: flex;
position: relative;
flex-wrap: nowrap;
button {
&:not(:first-child) {
border-radius: 0;
}
&:first-of-type {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-top-left-radius: 9999px;
border-bottom-left-radius: 9999px;
}
&:last-of-type {
border-top-right-radius: 9999px;
border-bottom-right-radius: 9999px;
}
}
&[uppercased] button {
text-transform: uppercase;
}
}
</style>