670 questions
1
vote
1
answer
59
views
CSS calc() differs in Samsung/Firefox vs Chrome/Edge
I’m working with the following code:
<div style="--w: 30px;"></div>
And I’m testing two expressions:
Test Case 1
calc(30px / 720px * 100vw)
Test Case 2
calc(var(--w) / 720px * ...
0
votes
1
answer
208
views
tailwind does not use CSS variables I defined in global.css [duplicate]
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 ...
3
votes
1
answer
109
views
CSS variables for custom component in a slot
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 -->
<...
1
vote
1
answer
94
views
Unexpected variable resolution order in CSS with var/property nesting [duplicate]
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 ...
1
vote
1
answer
107
views
Thin border artifacts around animated circular mask during clip-path transition
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 ...
-1
votes
2
answers
57
views
Can I combine minmax() with responsive length property in CSS? [duplicate]
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 { ...
-1
votes
1
answer
88
views
Rename Tailwind's color CSS variables?
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 ...
0
votes
0
answers
56
views
How to overwrite popup colors with variables and opacity via the color scheme?
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....
1
vote
2
answers
414
views
How to overwrite css variables value with scss variables
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 ...
1
vote
1
answer
104
views
How to use rem unit in initial-value for a CSS @property rule?
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 ...
1
vote
0
answers
72
views
Nuxt: Set custom CSS Var asap, depending on height of element
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);
}
...
1
vote
2
answers
112
views
Combine css variables into one variable
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 ...
1
vote
0
answers
21
views
CSS @property in declarative shadow DOM [duplicate]
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: "*";
...
1
vote
1
answer
37
views
Logging when a CSS variable not found
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
{
/* ...
0
votes
0
answers
16
views
css design token's value not updating [duplicate]
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-...