Spaces:
Sleeping
Sleeping
File size: 1,583 Bytes
f0953a4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
@mixin text-ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
// 响应式布局工具类
@mixin mobile {
@media screen and (max-width: 768px) {
@content;
}
}
@mixin tablet {
@media screen and (min-width: 769px) and (max-width: 1024px) {
@content;
}
}
@mixin desktop {
@media screen and (min-width: 1025px) {
@content;
}
}
// 通用样式变量
:root {
// 字体大小 - 整体缩小约25%
--font-size-xs: 20px; // 原24px
--font-size-sm: 22px; // 原26px
--font-size-base: 24px; // 原28px
--font-size-lg: 28px; // 原32px
--font-size-xl: 32px; // 原36px
// 间距 - 也相应缩小
--spacing-xs: 6px; // 原8px
--spacing-sm: 10px; // 原12px
--spacing-base: 14px; // 原16px
--spacing-lg: 20px; // 原24px
--spacing-xl: 28px; // 原32px
// 圆角 - 适当调整
--border-radius-sm: 6px; // 原8px
--border-radius-base: 10px; // 原12px
--border-radius-lg: 14px; // 原16px
--border-radius-xl: 20px; // 原24px
// 移动端特殊变量
@include mobile {
--font-size-base: 14px;
--spacing-base: 12px;
}
}
// 移动端适配
@media screen and (max-width: 768px) {
:root {
// 间距
--spacing-xs: 3px;
--spacing-sm: 5px;
--spacing-base: 7px;
--spacing-lg: 10px;
--spacing-xl: 14px;
// 字体大小
--font-size-xs: 10px;
--font-size-sm: 11px;
--font-size-base: 12px;
--font-size-lg: 14px;
--font-size-xl: 16px;
// 圆角
--border-radius-sm: 3px;
--border-radius-base: 5px;
--border-radius-lg: 7px;
}
}
|