@use 'sass:color'; @use "sass:map"; @use 'tokens'; // Layout Mixins @mixin container { @media (min-width: 768px) { padding: 0 tokens.$spacing-xl !important; } max-width: tokens.$container-max-width; margin: 0 auto; & { padding: 0 tokens.$spacing-md; } } @mixin flex-center { display: flex; align-items: center; justify-content: center; } @mixin flex-between { display: flex; align-items: center; justify-content: space-between; } @mixin grid-responsive($min-width: 300px, $gap: tokens.$spacing-lg) { display: grid; grid-template-columns: repeat(auto-fit, minmax($min-width, 1fr)); gap: $gap; > * { @media (max-width: 768px) { margin: 0 tokens.$spacing-md; } } } // Typography Mixins @mixin heading-primary { font-family: tokens.$font-family-heading; font-weight: tokens.$font-weight-bold; line-height: tokens.$line-height-tight; color: tokens.$text-primary; } @mixin heading-secondary { font-family: tokens.$font-family-heading; font-weight: tokens.$font-weight-semibold; line-height: tokens.$line-height-normal; color: tokens.$text-primary; } @mixin body-text { font-family: tokens.$font-family-primary; font-weight: tokens.$font-weight-normal; line-height: tokens.$line-height-normal; color: tokens.$text-primary; } @mixin text-small { font-size: tokens.$font-size-sm; color: tokens.$text-secondary; } // Button Mixins @mixin button-base { display: inline-flex; align-items: center; justify-content: center; padding: tokens.$spacing-sm tokens.$spacing-lg; border: none; border-radius: tokens.$border-radius-md; box-shadow: tokens.$shadow-lg; font-family: tokens.$font-family-primary; font-weight: tokens.$font-weight-medium; text-decoration: none; cursor: pointer; transition: all tokens.$transition-normal; &:disabled { opacity: 0.6; cursor: not-allowed; } &:hover:not(:disabled) { transform: translateY(-2px); box-shadow: tokens.$shadow-xl; } } @mixin button-primary($text-color: tokens.$text-primary, $background-color: tokens.$bg-primary) { @include button-base; background: linear-gradient(135deg, $background-color, color.adjust($background-color, $lightness: -10%)); color: $text-color; border: 2px solid $background-color; } @mixin button-secondary($border-color: tokens.$secondary-color, $hover-color: tokens.$text-inverse) { @include button-base; background: transparent; color: $border-color; border: 2px solid $border-color; &:hover:not(:disabled) { background: $border-color; color: $hover-color; } } @mixin button-accent { @include button-base; background: linear-gradient(135deg, tokens.$accent-color, color.adjust(tokens.$accent-color, $lightness: -10%)); color: tokens.$text-primary; } // Menu Mixins @mixin menu-base { display: flex; justify-content: center; flex-wrap: wrap; list-style-type: none; } // Card Mixins @mixin card-base { display: inline-grid; background: tokens.$bg-primary; border-radius: tokens.$border-radius-lg; box-shadow: tokens.$shadow-md; transition: all tokens.$transition-normal; } @mixin card-hover { &:hover { transform: translateY(-4px); box-shadow: tokens.$shadow-xl; } } @mixin card-interactive { @include card-base; @include card-hover; cursor: pointer; } // Form Mixins @mixin input-base { width: 100%; padding: tokens.$spacing-sm tokens.$spacing-md; border: 2px solid tokens.$border-light; border-radius: tokens.$border-radius-md; font-family: tokens.$font-family-primary; font-size: tokens.$font-size-base; transition: border-color tokens.$transition-fast; &:focus { outline: none; border-color: tokens.$primary-color; } &::placeholder { color: tokens.$text-light; } } // Animation Mixins @mixin fade-in($duration: tokens.$transition-normal) { animation: fadeIn $duration ease-in-out; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @mixin slide-up($duration: tokens.$transition-normal) { animation: slideUp $duration ease-out; } @keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } // Utility Mixins @mixin visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; } // Section Layout Mixins @mixin section-centered { max-width: tokens.$container-max-width; margin: 0 auto; } @mixin section-full-width { max-width: 100% !important; margin: 0 auto !important; }