question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extra closing parenthesis when using RGBa(), HSLa() as fallback value

See original GitHub issue

Hi,

This is how my vars look like:

--color-background-transparent-9: hsla(200, 20%, 25%, 0.9);
--color-background-tint: hsla(200, 15%, 90%, 1);

This is how I use them on an element:

background: var(--color-background-transparent-9, rgba(51, 68, 77, 0.9));
color: var(--color-background-tint, #e2e7e9);

This is how css-vars-ponyfill converts them:

background: hsla(200, 20%, 25%, 0.9));
color: hsla(197, 14%, 90%, 1);

Notice the extra closing parenthesis in the background property.

After a bit of investigation, it seems that the issue is the fallback value. If I replace the rgba(51, 68, 77, 0.9) with #e2e7e9 it works.

Does anyone have this issue before? Do you may know any workaround?

Thanks in advance! George

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
jhildenbiddlecommented, Nov 29, 2018

Fixed in 1.15.3.

Thanks for the excellent description and debugging efforts. Made the fix much easier. 😄

Let me know if the fix resolves your issues. I’ll hold off closing the issue until then.

0reactions
georgechond94commented, Nov 29, 2018

Yep, it works great for me too! Many thanks for the instant fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parsing of rgb()/rgba()/hsl()/hsla() CSS color values ... - GitHub
When setting the canvas' fill/stroke style, rgb() / rgba() and hsl() / hsla() color values with missing close-parentheses such as rgb(255, 0, 0 ......
Read more >
Setting Backgrounds & Gradients - Learn to Code HTML & CSS
Transparent Backgrounds. When using an RGBa or HSLa value as a transparent background color, it's a good idea to provide a fallback color,...
Read more >
Glassmorphism for Firefox - Medium
The filter: blur() makes the entire element blurred. Adjust the pixel value in parentheses to achieve the desired degree of blurriness. Here's ...
Read more >
The CSS Handbook - The Valley of Code
HSL and HSLa ... Interacting with a CSS Variable value using JavaScript; 19.5. ... rgba() lets you add the alpha channel to enter...
Read more >
CSS References · Prince Documentation
Prince supports opacity . It supports some of the extensions of the color property. rgba() is supported in builds after Prince 11, hsl()...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found