I have a button component with a little accent styling on the left of the button. I want the button to get height based on the content. The "text"-variable could be any text, so it could change any time. i want the button accent to scale with the text, but I can't use 100% or anything like that cause its parent doesnt have any sett height (because I want it to fit content). The button_accent do get height when i set manually, but i want it dynamicly
<div className={`${buttonStyles.button}`} >
<div className={`${buttonStyles.button_accent} h-full`}></div>
<div className="mr-3 ml-3 justify-start w-full flex items-center">
{text}
</div>
</div>
Button.module.css:
.button {
display: flex;
height: auto;
min-height: 80px;
border: 1px solid #d8fc9133;
font-size: 24px;
color: white;
font-weight: medium;
background: rgb(128, 128, 128, 0.5);
align-items: center;
}
.button:hover {
background: rgb(128, 128, 128, 1);
cursor: pointer;
}
.button_accent {
width: 12.77px;
background-color: #d8fc91;
}
Heres the button with the accent with height set to 65px. (with no height set, the accent gets 0 height)
