| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- @use "sass:color";
- // 按钮高光(无 hover/active 效果)
- @mixin highlight-glow($base-color) {
- $light-color: color.adjust($base-color, $lightness: 8%);
- $dark-color: color.adjust($base-color, $lightness: -10%);
-
- background: linear-gradient(135deg, $light-color 0%, $dark-color 100%);
- box-shadow:
- inset 0 1px 2px rgba(255, 255, 255, 0.3),
- inset 0 -1px 2px rgba(0, 0, 0, 0.3),
- 0 2px 4px rgba(0, 0, 0, 0.2);
- position: relative;
- overflow: hidden;
-
- &::before {
- content: '';
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- height: 50%;
- background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
- pointer-events: none;
- }
- }
- // 按钮高亮(含 hover/active)
- @mixin highlight-btn($base-color) {
- $light-color: color.adjust($base-color, $lightness: 8%);
- $dark-color: color.adjust($base-color, $lightness: -10%);
- $hover-light: color.adjust($base-color, $lightness: 12%);
- $hover-dark: color.adjust($base-color, $lightness: 2%);
- $active-dark: color.adjust($base-color, $lightness: -15%);
- $active-darker: color.adjust($base-color, $lightness: -20%);
-
- background: linear-gradient(135deg, $light-color 0%, $dark-color 100%);
- box-shadow:
- inset 0 1px 2px rgba(255, 255, 255, 0.3),
- inset 0 -1px 2px rgba(0, 0, 0, 0.3),
- 0 2px 4px rgba(0, 0, 0, 0.2);
- position: relative;
- overflow: hidden;
- cursor: pointer;
- transition: all 0.2s ease;
-
- &::before {
- content: '';
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- height: 50%;
- background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
- pointer-events: none;
- }
-
- &:hover {
- background: linear-gradient(135deg, $hover-light 0%, $hover-dark 100%);
- box-shadow:
- inset 0 1px 2px rgba(255, 255, 255, 0.4),
- inset 0 -1px 2px rgba(0, 0, 0, 0.3),
- 0 3px 6px rgba(0, 0, 0, 0.3);
- }
-
- &:active {
- background: linear-gradient(135deg, $active-dark 0%, $active-darker 100%);
- box-shadow:
- inset 0 2px 4px rgba(0, 0, 0, 0.4),
- 0 1px 2px rgba(0, 0, 0, 0.2);
- }
- }
- // ========== Mixin 配置 ==========
- @mixin flex-center {
- display: flex;
- align-items: center;
- justify-content: center;
- }
-
- @mixin flex-row-between {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
- }
-
- @mixin flex-column-start {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: flex-start;
- }
-
- @mixin flex-column-between {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: space-between;
- }
-
- @mixin box-sizing-border-box {
- box-sizing: border-box;
- overflow: hidden;
- margin: 0;
- padding: 0;
- }
- @mixin div-btn-hover-effect {
- transition: transform 0.2s ease;
- &:hover {
- transform: scale(1.05);
- }
- }
- @mixin div-btn-pressed-effect {
- transition: transform 0.1s ease;
- &:active {
- transform: scale(0.95);
- }
- }
|