Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
112 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
3 votes
1 answer
100 views

I have a custom component which is using another component within it but slotted. The component is set up like this: <div class="nys-modal"> <!-- rest of component --> <...
Emily Gorelik's user avatar
1 vote
1 answer
73 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,157
1 vote
1 answer
91 views

I have a custom button with a circular mask hover animation using clip-path and CSS custom properties (@property + --tx / --ty). The effect works just fine, but I see thin visible borders/artifacts ...
mmdwc's user avatar
  • 1,157
-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,748
-1 votes
1 answer
77 views

I'm using Tailwind and shadCN UI. My theme needs my primary color to be in a css file and have this name: :root { --primary: oklch(0.205 0 0); } However instead of setting the color value directly ...
Evanss's user avatar
  • 22.5k
0 votes
0 answers
56 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
2 answers
349 views

I am working with primeng and would like to overwrite the css variable value. (this is not important but this will make my issue more clear and what I try to achieve) for example if I have an badge ...
Babulaas's user avatar
  • 899
1 vote
1 answer
90 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
0 answers
66 views

I have a page, served with Nuxt SSR. It has a header with position:fixed and content that will have a padding-top that equals the header's height: .content { padding-top: var(--header-height); } ...
vuelicious's user avatar
1 vote
2 answers
100 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
0 answers
21 views

It is possible to use CSS' @property rule to define CSS variables like in the following example (https://codepen.io/sbhmn/pen/pvzmvvx): <style> @property --bg-color { syntax: "*"; ...
SUBHUMAN's user avatar
  • 378
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
0 answers
16 views

TLDR; why is the button text white? Codepen to demo: https://codepen.io/bental/pen/vEBdQvJ I have css variables defined as such: :root { --neutral-00: white; --neutral-100: black; --general-...
Ben Taliadoros's user avatar
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
1 answer
177 views

I have an angular webcomponent that I build with the help of @angular/elements. The webcomponent has been working in my website for months, so most of the code, deployment and loading is ok. The ...
andymel's user avatar
  • 6,048
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
2 answers
81 views

I have a simple react app (Vite project) app.tsx import "./common-styles.css"; export default function App() { return ( <div className="app"> <div className=&...
timo's user avatar
  • 25
0 votes
0 answers
28 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
2 votes
1 answer
50 views

In this answer Can I use the auto value with the calc() property? the author says that auto is not valid value for the calc() expression. Ok, fine. But the problem I have is that I have a CSS custom ...
jcubic's user avatar
  • 67.1k
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
1 answer
289 views

I've got some code I'm writing for a website builder that's causing me issues. We're using CSS variables to define global styles, with both desktop and mobile layout options, e.g.: :root { --section-...
Steven Moseley'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
1 vote
2 answers
1k views

I have in css (generated by sass) variable called --secondary and it's value is red(#f00) I want to create more variables for opacity like --secondary-100, --secondary-90, ... I used color-mix in ...
Fire Gamer's user avatar
0 votes
1 answer
47 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 vote
1 answer
2k views

We have a design system that comes with a number of CSS custom properties for colors, e.g.: :root { --color--blue-1: oklch(88.6% 0.023 238); } We're using the relatively new color format oklch. Now ...
connexo's user avatar
  • 57.2k
-1 votes
1 answer
357 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
0 votes
1 answer
186 views

Using Bootstrap (currently v5.3.3) I am using a custom-built WordPress theme and setting a whole group of overrides for the colours used. The custom-built WordPress theme stylesheet is loaded last, ...
Lee's user avatar
  • 4,319
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
265 views

As it stands, CSS Custom Properties enjoys a global tracked base of 99.05% support according to CanIUse. Most of this is due to IE support that has one of a number off poly fills particularly when ...
Walrus's user avatar
  • 20.6k
0 votes
1 answer
521 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
  • 296
0 votes
0 answers
739 views

In JavaScript I need to read all the CSS vars that have been applied to an HTML element. If I know the name of a CSS variable eg --thing I can get it's value with this code. This works in both Chrome ...
Evanss's user avatar
  • 22.5k
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
4 votes
1 answer
1k views

I'm using color-mix to take a button's background-color (set via a custom property) and make it lighter on hover. I expected browsers that don't support color-mix to simply ignore the hover state and ...
Jon's user avatar
  • 170
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
2 answers
110 views

font.newFileName is a string of only numbers: '000001101', '000001102', '000001103', so on and so forth. If font.newFileName in new FontFace and setProperty is prefixed with a letter or changed to a${...
oldboy's user avatar
  • 6,076
0 votes
1 answer
281 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
0 answers
905 views

I'm working with Next.js, Ant Design, and Tailwind CSS, implementing multi-theme functionality in my globals.css file. I am currently facing an issue with changing the primary-color value in Ant ...
ahmetarslan's user avatar
0 votes
1 answer
284 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
2 answers
732 views

I'm trying to set a CSS custom property within the :root and then change the value depending on the container's size using a container query, but it's not working. Here's an example: <div class=&...
Nicholas Westby's user avatar
1 vote
0 answers
107 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
2 votes
1 answer
270 views

Let’s assume we have the following CSS Custom Properties: // Global CSS :root { --font-weight-500: 500; --font-size-350: 14px; --font-line-height-500: 20px; --font-family-sans: 'Roboto Flex', ...
Runicode's user avatar
  • 341
3 votes
0 answers
198 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
1 vote
2 answers
531 views

I am having trouble seeing why the following CSS code involving custom css variables fails to work as expected: html <ul class="grid"> <li>1</li> <li>2</li> <...
Nikos M.'s user avatar
  • 8,393
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
2 votes
0 answers
103 views

"I'm attempting to create a gallery where clients can choose the number of columns. I've implemented a range selector in my admin panel, allowing clients to choose between 1 and 6 columns. I've ...
Janine Margueron's user avatar
0 votes
1 answer
214 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 votes
2 answers
297 views

I'm setting up a design system in NextJS14 (React). We are using CSS modules and have all colors stored in CSS variables (custom properties). We have these nice-looking buttons in our Figma design. I ...
Dirk's user avatar
  • 3
1 vote
1 answer
730 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 vote
0 answers
1k views

I've got a WordPress child theme that I'd like to adjust the theme-color meta tag for, but I'd like to be able to change it via the GUI in future rather than jumping back into functions.php (and I don'...
user1395909's user avatar

1
2 3 4 5
14