Using variables to build clean, reusable CSS components.
Variables make styling reusable, maintainable, and easier to update. Here’s how you can build a button using SCSS variables.
$primary: #0077ff;
$hover: #005fcc;
$padding: 14px 22px;
$radius: 8px;
$font-size: 16px;
.button {
background: $primary;
padding: $padding;
border-radius: $radius;
color: white;
border: none;
font-size: $font-size;
cursor: pointer;
transition: 0.3s;
&:hover {
background: $hover;
}
}