user1941537
user1941537

Reputation: 6675

Does MS Edge support CSS custom properties

According to this page:

https://caniuse.com/#search=custom%20properties

Microsoft Edge should support CSS custom properties from version 15. I have the latest MS Edge installed on my Windows 10 and it shows the following version:

Microsoft Edge 44.17763.831.0

Microsoft EdgeHTML 18.17763

Based on that info, I assume that I'm using MS Edge version 18, which should support CSS custom properties. But it doesn't seem to support it as something like this statement is not working:

:root {
  // Color definitions
  --white: 255, 255, 255;
}

background-color: rgba(var(--white));

Any thoughts and suggestions would be appreciated.

Upvotes: 0

Views: 565

Answers (1)

user1941537
user1941537

Reputation: 6675

I found the answer to my question.

Microsoft Edge supports CSS Custom Properties since Edge version 15. However, if you use rgba instead of rgb, you have to set the value of a (alpha channel):

This won't work in Edge:

background-color: rgba(var(--white));

This will work:

background-color: rgba(var(--white), 1);

background-color: rgba(var(--white), 0.8);

I hope it helps others who are facing the same issue.

Upvotes: 1

Related Questions