Cascading Style Sheets (CSS)
CSS dictates how HTML elements are presented—it is the language of design. The Cascading nature refers to how styles inherit properties from their parent elements and how the order of rules determines which style wins.
Design Fundamentals
Effective styling relies on more than just colors. Using a system ensures consistency, which is why we defined our colors and spacing using CSS Custom Properties (variables) in the `:root` selector.
Defining Variables
:root {
--color-primary: oklch(20.768% 0.03985 265.767);
--color-secondary: oklch(75.353% 0.13906 232.691);
--space-sm: 0.5rem;
--space-md: 1rem;
}
Using CSS Variables
.button-primary {
background-color: var(--color-secondary);
color: white;
padding: var(--space-md) var(--space-lg);
}
This allows us to change the look and feel of the entire site instantly by updating a few variable value.