Top "Css-variables" questions

Custom properties (or CSS variables) allow to define stylesheet-wide values identified by a token and usable in all CSS declarations.

How can I define colors as variables in CSS?

I’m working on a CSS file that is quite long. I know that the client could ask for changes …

css variables colors css-variables
How do I apply opacity to a CSS color variable?

I am designing an app in electron, so I have access to CSS variables. I have defined a color variable …

css colors css-variables
CSS native variables not working in media queries

I am trying to use CSS variables in media query and it does not work. :root { --mobile-breakpoint: 642px; } @media (max-width: …

css media-queries css-variables
Access CSS variable from javascript

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

javascript css css-variables
Is there a way to interpolate CSS variables with url()?

I want to store my background URLs in custom properties (CSS variables) and use them with the background property. However, …

css css-variables
CSS Variables with background-image url

Am I misunderstanding the capabilities of css variables? I am trying to pass a background image url to a variable …

css css-variables
CSS variables use in Vue

Is it possible to use pure CSS variables with Vue without having to link any stylesheets or use SASS/PostCSS? …

css vue.js global-variables css-variables
Accessing a CSS custom property (aka CSS variable) through JavaScript

How do you get and set CSS custom properties (those accessed with var(…) in the stylesheet) using JavaScript (plain or …

javascript jquery css css-variables
Use CSS variables with rgba for gradient transparency

Is there a way to use CSS variables when specifying gradient colors with transparency, e.g. :root { --accent-color: #dfd0a5; } …

css css-variables
CSS custom properties polyfill for ie11

Is there a way to pollyfill a custom CSS property for ie11 with JavaScript? I was thinking on load, check …

javascript css internet-explorer-11 css-variables