Mid
From PDF
JavaScript
JavaScript
How do you use CSS variables?
Define a variable with --name and access it with var().
Example:
:root {
- -main-color: #007bff;
- -padding: 10px;
}
button {
background: var(--main-color);
padding: var(--padding);
}
Follow me on LinkedIn:
Key Takeaway:
CSS variables make styles dynamic and reusable.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png