Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
104 views

I am trying to make an app, using tailwind for styling. The problem emerges when I try to use my variables with tailwind. I made seperate config for tailwind, declared the variables in global.css, but ...
seena's user avatar
  • 1
1 vote
1 answer
70 views

My goal is to have an architecture where the shadow is defined once, but the color changes depending on HTML attribute data-color-mode. Note: code provided is just for the isolated problem ...
Slava's user avatar
  • 3,147
-1 votes
2 answers
48 views

I had the idea to use responsive font-size in CSS, so that the font size would depend on the viewport width, but be limited for minimum and maximum size, like this: @property --font-size-norm { ...
U. Windl's user avatar
  • 4,738
0 votes
0 answers
55 views

1. Summary I can’t find how I can overwrite via my color scheme colors in Sublime Text popups, if colors has variables and the color-mod function. 2. MCVE For example, I have the file KiraExample....
Саша Черных's user avatar
1 vote
1 answer
88 views

I'm trying to define a CSS @property rule for a font-size with a rem-based initial value. https://developer.mozilla.org/en-US/docs/Web/CSS/@property It works as long as no syntax is defined: @property ...
Tobias Wittwer's user avatar
1 vote
2 answers
99 views

I'm trying to combine/compose multiple css variables into one that I can use but it doesn't seem to be working. In particular I'm trying to combine separate font rules into one where I can then use ...
magenta placenta's user avatar
1 vote
1 answer
36 views

Is there a way to make a browser log events, when a CSS variable is not found? I'm wondering, because it seems to be useful for debugging. Say, if I have the following code: .stroked-text { /* ...
Shtole's user avatar
  • 367
0 votes
1 answer
101 views

I have a custom HTML element I made that creates a repeating background pattern which I animate in. I need the ability to dynamically set the color of this pattern with a CSS variable that lives in ...
Chris Barr's user avatar
  • 34.6k
0 votes
0 answers
92 views

In my website, I've a sticky container with a horizontal scroll direction. The scroll works perfectly. However the issue is, when I tried to get a value from a CSS variable and assign it to Javascript ...
Mathieu Préaud's user avatar
0 votes
0 answers
27 views

[EDIT]: To moderators, please read the question carefully before being in hurry to mark the question duplicate. This question more to take CSS variable value from JS (set in element style) and not to ...
Ashish Kumar's user avatar
  • 3,039
1 vote
0 answers
49 views

Given the following code, the text color is correctly changed in the nested element after updating the root css variable. Is there a way to avoid repeating the color prop twice and get it ...
Marco Gagliardi's user avatar
1 vote
2 answers
77 views

we are using a design system that has 'tokens' and 'primitives'. the idea is that we can connect different baseColors to a different UI-elements depending on the brand. <h1>Hi this is header&...
Jason Teunissen's user avatar
0 votes
1 answer
40 views

How do I create this HTML in Reagent/hiccup? <span style="--custom-property: value"></span> Both Hiccup and Reagent fail to document how to pass CSS custom properties.
Nick Ribal's user avatar
  • 2,106
-1 votes
1 answer
354 views

I have a number of CSS variables containing color values. I'd like to define these in HSL format, but can I let Sass convert these to hex values? Input: :root { --dark: hsl(210, 50%, 13%); } Output:...
Peter's user avatar
  • 3,047
1 vote
0 answers
72 views

I have a UI components repo setup with rollup where I want to use my css variables inside my javascript files. I have done this in another repo which was using webpack and it was quite easy: import ...
Shubham Chitransh's user avatar
0 votes
1 answer
518 views

I was wondering if it's possible to nest a CSS Variable within a CSS variable's name or possibly do something similar: :root { --color-1: red; --index: 1; } span { color: var(--color-var(--...
Hazrd's user avatar
  • 276
1 vote
1 answer
1k views

how can I use an environment variable to specify the base color in my CSS ? I use NEXTJS My colors are all defined as variables in my globals.css : @layer base { :root { ... --primary: #...
Max's user avatar
  • 708
0 votes
0 answers
32 views

It seems to me that the best way to use CSS variables in many cases is to have them default to a pre-existing value but have a sensible default. E.g. instead of writing: :host { --background: white; ...
podperson's user avatar
  • 2,393
0 votes
1 answer
279 views

How can I override a css variable from dev console (or injected script of extension) For example for google.com search page lets say I want to change rhs-width variable. I can clearly see it defined ...
ishandutta2007's user avatar
0 votes
1 answer
282 views

I am using VueJS to define two custom web elements, service-card and slot-card. I allow CSS variables, e.g. --pm-scale: 0.75, to customize the style of the elements. slot-card can be used ...
Franck's user avatar
  • 39
1 vote
0 answers
106 views

So I'm trying to apply a series of modifications to a color via a custom property, but as far as I can tell it can only go one level deep. Unless I can find a way to extract the color value from the ...
qodeninja's user avatar
  • 11.3k
3 votes
0 answers
195 views

EDIT: I found that the issue is that during build, the generated css file has the %, from initial-value removed, so it results in just initial-value:0 which is not correct since i'm using perchantage. ...
Gr33nLight's user avatar
0 votes
1 answer
213 views

Suppose I'm developing a reusable component, rendered as an HTML element. It can be rendered by anybody in some container. I don't know the styles of the container in advance: it could have a fixed ...
Alex Grin's user avatar
  • 3,270
0 votes
1 answer
211 views

I want to make a hover effect over a p-tag, when hovered the background should get darker. I used filter:brightness(85%) but this made also the text darker. Here is my css. :root { --my-color:193 55% ...
Tim Graf's user avatar
1 vote
1 answer
725 views

I am rendering the following style very early in the <head> : <style> :root { --enhanced: false; } @supports (selector(:not(.foo))) and (aspect-ratio: 1 / 1) and (margin-block-...
theclarkofben's user avatar

1
2 3 4 5
14