assets > styles
$primary-color: #3498db; $secondary-color: #2ecc71; .button { background-color: $primary-color; color: #fff; &:hover { background-color: $secondary-color; } }
.card { border: 1px solid #ccc; padding: 16px; .card-title { font-size: 20px; font-weight: bold; } .card-content { font-size: 16px; color: #666; } }
@mixin flex-center { display: flex; justify-content: center; align-items: center; } .container { @include flex-center; height: 100vh; background-color: #f5f5f5; }
.button { padding: 10px 20px; border-radius: 4px; color: #fff; } .button-primary { @extend .button; background-color: $primary-color; } .button-secondary { @extend .button; background-color: $secondary-color; }
@function calculate-spacing($value) { @return $value * 8px; } .container { margin: calculate-spacing(2); // Output: 16px padding: calculate-spacing(3); // Output: 24px }
buttons.scss
variables.scss
Was this page helpful?