Mabey stupid question but it seems I cant use rgba in my lit-element.
You can use HEXColors with rgba as you can se in this codepen:
https://codepen.io/bassetts/pen/RqrPWG
And you can use varibles with rgba as you can see here:
https://codepen.io/finnhvman/post/theming-with-css-variables-in-rgba
If use this solution, the border dosent render out:
border: 0.3rem solid rgba(var(--application-color, black), 0.3);//dont work
Same goes for this
border: 0.3rem solid rgba(#000, 0.3);//dont work
If I use this solution the border renders out at it works.
border: 0.3rem solid rgba(250,0,0, 0.3); //Works!
My code:
public render(): TemplateResult {
return html`<div class="main-content">
<div class=${classMap({ donut: this.loading })}></div>
</div>
`;
}
public static get styles(): CSSResult {
return css`
:host {
display: block;
}
.main-content {
padding: 30px;
background-color: #fafafa;
text-align: center;
}
.donut {
width: 2rem;
height: 2rem;
margin: 1rem;
border-radius: 50%;
border: 0.3rem solid rgba(var(--application-color, black), 0.3);//dont work
//border: 0.3rem solid rgba(250,0,0, 0.3); //Works!
border-top-color: var(--application-color, black);
-webkit-animation: 1.5s spin infinite linear;
animation: 1.5s spin infinite linear;
}
@keyframes spin {
to {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
`;
}
Any ideas what im doing wrong?