增加字体大小设置

This commit is contained in:
2026-07-03 11:45:16 +08:00
parent 451dd2330b
commit c3bd7960d0
28 changed files with 894 additions and 94 deletions
+15 -9
View File
@@ -7,6 +7,12 @@ page {
font-size: $font-size-base;
color: $text-primary;
line-height: 1.5;
/*
* 使用 rem 方案后,不需要设置固定的 font-size
* 所有元素使用 rem 单位,会自动相对于根字体大小计算
* 根字体大小由 JavaScript 动态设置(document.documentElement.style.fontSize
*/
}
/* 清除默认样式 */
@@ -92,7 +98,7 @@ button {
.back-btn {
margin-right: 8px;
font-size: 20px;
font-size: $font-size-xl;
padding: 4px;
}
@@ -542,7 +548,7 @@ button {
flex-shrink: 0;
.iconfont {
font-size: 22px;
font-size: $font-size-xl;
}
}
@@ -574,7 +580,7 @@ button {
.ledger-arrow {
color: #cccccc;
font-size: 16px;
font-size: $font-size-md;
}
/* 设置页面 */
@@ -601,7 +607,7 @@ button {
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
font-size: $font-size-xl;
}
.settings-name {
@@ -643,7 +649,7 @@ button {
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
font-size: $font-size-lg;
background: #f0f0f0;
margin-right: $spacing-base;
flex-shrink: 0;
@@ -674,7 +680,7 @@ button {
.s-arrow {
color: #cccccc;
font-size: 14px;
font-size: $font-size-md;
}
.version-info {
@@ -708,7 +714,7 @@ button {
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
font-size: $font-size-lg;
background: #f0f0f0;
flex-shrink: 0;
}
@@ -732,7 +738,7 @@ button {
.sub-menu-arrow {
color: #cccccc;
font-size: 14px;
font-size: $font-size-md;
}
/* 设备管理 */
@@ -756,7 +762,7 @@ button {
}
.device-icon {
font-size: 18px;
font-size: $font-size-lg;
}
.device-title {
+22 -9
View File
@@ -1,3 +1,25 @@
// ============================================
// 📌 字体大小 - 使用 rem 单位(推荐方案)
// ============================================
// 核心原理:
// 1. rem 相对于根元素(page/html)的字体大小计算
// 2. 只需要修改根字体大小,所有 rem 会自动缩放
// 3. 基准:1rem = 16px(浏览器默认值)
// 4. 字体缩放时,修改 document.documentElement.style.fontSize 即可
// 基础字号(基于 16px 基准)
$font-size-xs: 0.625rem; // 10px / 16px
$font-size-sm: 0.6875rem; // 11px / 16px
$font-size-base: 0.8125rem; // 13px / 16px
$font-size-md: 0.875rem; // 14px / 16px
$font-size-lg: 1rem; // 16px / 16px
$font-size-xl: 1.25rem; // 20px / 16px
$font-size-xxl: 1.5rem; // 24px / 16px
// ============================================
// 📌 SCSS 变量(主题、颜色等)
// ============================================
// 主题色
$primary-color: #1890ff;
$success-color: #52c41a;
@@ -43,15 +65,6 @@ $border-radius-md: 10px;
$border-radius-lg: 14px;
$border-radius-xl: 20px;
// 字体大小
$font-size-xs: 10px;
$font-size-sm: 11px;
$font-size-base: 13px;
$font-size-md: 14px;
$font-size-lg: 16px;
$font-size-xl: 20px;
$font-size-xxl: 24px;
// 间距
$spacing-xs: 4px;
$spacing-sm: 8px;