<ButtonAtom></ButtonAtom>
this is my custom button component.
<template>
<div>
<button class="px-2 py-1" :class="[borderRadius, backgroundColor]">
<slot />
</button>
<div>
</template>
and this is the html tag within the component.
If I add CSS to the <ButtonAtom>
like
<ButtonAtom color="white">
the color applies to the root tag, which is <div>
The challenge is trying to apply the CSS to the <button>
instead.
Is there a way to style the <button>
without removing the root HTML <div>
?
P.S. This is for Vue3 project.