I have a requirement where the user can change the theme by setting his own colors from the provided drop down. Based on this color me as a developer will apply different shades to all the sections as below
Say, if the user picked up Green then, I want to use Green for the primary header, and Green with opacity 0.6 for table headers, and Green with opacity 0.5 for active/selected table row.
I have tried the below format, passing a variable to rgba is not affecting the background color.
CSS
:root {
--color: #008000;
--alpha: 0.5;
}
#primary-header{
background-color: rgba(var(--color));
}
#table-header{
background-color: rgba(var(--color), var(--alpha));
}