Category "css-variables"

How do I pass the dynamic output of a php variable or php function to a CSS variable?

The WordPress plugin PolyLang provides translations to a chosen language. Its functionality of "Strings translations" consists of a list of strings with custom

How to create color shades using CSS variables similar to darken() of Sass?

I'm looking a way of modifying a CSS variable as you would in SCSS Define a color like primary - and automatically I would get shades for focus and actives sta

CSS: Using hsl variable in hsla?

Say I have a CSS variable for an hsl defined as such: --white-1: hsl(0deg 0% 100%); Now, I want to use that same white, but at 50% opacity. So, something like

How can I set Bootstrap 5's CSS variables using :root?

I have a Bootstrap 5 application that consumes a bunch of web components and all of the components use Bootstrap 5. I need to customize the theme on the fly ins

Access CSS variable from javascript [duplicate]

Is there a way to access a css variable from javascript? Here my css variable declaration. :root { --color-font-general: #336699; }