JSFiddle - React, Tailwind, and code Playground
New CSS Color Level 4 ways to create rgba().
HTML
<div></div>
CSS
body {
--rgb: 255 0 0;
--a: 0.5;
}
div {
background-color: rgb(var(--rgb) / var(--a));
height: 200px;
width: 200px;
}
<div></div>
body {
--rgb: 255 0 0;
--a: 0.5;
}
div {
background-color: rgb(var(--rgb) / var(--a));
height: 200px;
width: 200px;
}