Skip to content

Commit 3c4e1db

Browse files
committed
fix pill classes
1 parent 69e0b07 commit 3c4e1db

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed
Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
2-
<p class="text-xs rounded-xl px-16 py-4 inline-block text-nowrap"
3-
:class="`bg-${backgroundColour} text-${textColour}`"
2+
<p
3+
class="text-xs rounded-xl px-16 py-4 inline-block text-nowrap"
4+
:class="getColourClasses(props.colour)"
45
>
56
<slot></slot>
67
</p>
@@ -9,13 +10,20 @@
910
<script setup lang="ts">
1011
1112
const props = defineProps({
12-
backgroundColour: {
13+
colour: {
1314
type: String,
1415
default: 'grey'
1516
},
16-
textColour: {
17-
type: String,
18-
default: 'white'
19-
}
2017
});
18+
19+
function getColourClasses(colour: string): string {
20+
switch (colour) {
21+
case 'grey':
22+
return 'bg-grey-400 text-white';
23+
// add more colours here as needed
24+
default:
25+
return 'bg-grey-400 text-white';
26+
}
27+
}
28+
2129
</script>

0 commit comments

Comments
 (0)