Lea Verou 10/15/2021

Custom properties with defaults: 3+1 strategies

Read Original

This CSS tutorial discusses strategies for setting default values when using CSS custom properties (variables) to style reusable components. It explains the problems with common approaches and proposes methods to allow for inheritance and easier overrides while avoiding code repetition.

Custom properties with defaults: 3+1 strategies

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

1
ServiceNow and Microsoft Copilot
Marius Sandbu 1 votes
2
The Learning Loop and LLMs
Martin Fowler 1 votes