CSS Custom Properties
The problem: keeping "DRY" (don't repeat yourself) in CSS can be hard impossible.
CSS Custom Properties provides a way forward!
section {
--spacing: 1.2rem;
padding: var(--spacing);
margin-bottom: var(--spacing);
}
Steps:
- Define the property
--spacing: 1.2rem;
- Use the property
padding: var(--spacing); margin-bottom: var(--spacing);