46 lines
765 B
Svelte
46 lines
765 B
Svelte
<script lang="ts">
|
|
export let color: 'red' | "green" | 'blue'= "red";
|
|
</script>
|
|
|
|
<p class={color}><slot /></p>
|
|
|
|
<style lang="scss">
|
|
@import '../../variables';
|
|
.red {
|
|
color: $red;
|
|
}
|
|
.green{
|
|
color: $green;
|
|
}
|
|
.blue {
|
|
color: $contrast;
|
|
}
|
|
p {
|
|
font-size: 0.8em;
|
|
height: 18px;
|
|
padding: 2px 5px;
|
|
font-weight: 400;
|
|
line-height: 18px;
|
|
border-radius: 3px;
|
|
box-sizing: content-box;
|
|
position: relative;
|
|
&::after {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: currentColor;
|
|
opacity: 0.2;
|
|
transition: opacity 0.2s;
|
|
z-index: 0;
|
|
border-radius: 3px;
|
|
}
|
|
&:hover::after{
|
|
opacity: .3;
|
|
}
|
|
|
|
}
|
|
</style>
|