Hey John, Want to add a few points on CSS variables.
.myClass { background-color: var(--bg-color , black) color: var(--text-color , white) }
The values after the comma, represent fallback values.
A variable declared in :root , means it's in the root element ( think it as html tag ) Hence it is accessible globally.
And yes, on dev, to get such colourful code, just use "js" after first commas
Cheers !
Thanks for your comment. Some great points ❤
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey John,
Want to add a few points on CSS variables.
The values after the comma, represent fallback values.
And yes, on dev, to get such colourful code, just use "js" after first commas
Cheers !
Thanks for your comment. Some great points ❤