argyleink / open-props

CSS custom properties to help accelerate adaptive and consistent design.
https://open-props.style
MIT License
4.78k stars 193 forks source link

--radius-conditional 1e5 syntax doesn't work in Firefox #448

Closed wcDogg closed 10 months ago

wcDogg commented 11 months ago

Here is a Codepen showing the issue: https://codepen.io/wcDogg/pen/bGzPwpw

In Firefox 120.0.1, no radius is applied when using this:

--radius-1e5: clamp(0px, calc(100vw - 100%) * 1e5, var(--radius-4));

However, this does work:

--radius-9999: clamp(0px, calc(100vw - 100%) * 9999, var(--radius-4)); 
argyleink commented 11 months ago

hmmm... that scientific notation is old school, sounds like a regression in firefox? i'll do some investigation on this, thanks!

argyleink commented 11 months ago

hehe, 1e3 and 1e4 work, but not anything 1e5 and above 🤦🏻

argyleink commented 11 months ago

https://bugzilla.mozilla.org/show_bug.cgi?id=1870297

argyleink commented 11 months ago

so i guess, until that bug is fixed (and maybe just forever), we make all the calc's use 1e4…?

wcDogg commented 11 months ago

Glad the answer was easy to find - I didn't even think of trying 1e3 or 1e4. Should I close this?

argyleink commented 11 months ago

i was going to say leave it open.. but it seems that the calc() in firefox is fine with the 1e5 notation, when it's inside a custom property 🤔

https://codepen.io/argyleink/pen/yLZdjrE/56b6355cf0248aff95e6923e70f76b8f

like, the OP library vars dont seem to fail. can you confirm that? if so, we can close this

wcDogg commented 11 months ago

Sorry - not sure what the ask is? But, if you open that pen in Firefox, --radius-conditional-3 is not working.

wcDogg commented 11 months ago

Is the ask to try an OP variable directly like this? No love in Firefox.

https://codepen.io/wcDogg/pen/GRzbGxO

argyleink commented 11 months ago

for me just now: Firefox 120 - shows this bug Firefox 121 - this bug doesnt happen

which version are you testing in?

wcDogg commented 11 months ago

Firefox 120.0.1

argyleink commented 11 months ago

wanna try 121 and verify the bug is gone? then we can just close this as a temporary firefox regression of 120

wcDogg commented 11 months ago

Sorry, no - Firefox says I'm up to date with 12.0.1 - I even tried reinstalling it. I'm on Windows 11

argyleink commented 10 months ago

looks like they fixed it https://bugzilla.mozilla.org/show_bug.cgi?id=1870297