refactor(miniprogram): 全面接入 Design Token — 68 SCSS 文件 px→var(--tk-*)
Some checks failed
CI / security-audit (push) Has been cancelled
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled

- 重写 tokens.scss:校准 10 级字号 + 4 结构 token 匹配实际设计值
- 更新 mixins.scss:4 个 mixin 引用 token 替代硬编码
- 68 SCSS 文件全面迁移:font-size px → var(--tk-font-*),辅助文字色 → var(--tk-text-secondary)
- 清理 12 个页面的本地 mixin 重复定义
- elder-mode.scss 从 530 行缩减至 ~120 行:删除所有字号/颜色覆写,仅保留结构布局
- Token 覆盖率:634 引用 / 仅 3 个特殊硬编码值(72px/80px/21px)

关怀模式通过 CSS 变量级联自动生效,消除"打地鼠"问题。
This commit is contained in:
iven
2026-05-09 23:53:07 +08:00
parent 257ca94a25
commit 890c132890
74 changed files with 1127 additions and 1688 deletions

View File

@@ -1,34 +1,5 @@
@import '../../../styles/variables.scss';
@mixin serif-number {
font-family: 'Georgia', 'Times New Roman', serif;
font-variant-numeric: tabular-nums;
}
@mixin section-title {
font-family: 'Georgia', 'Times New Roman', serif;
font-size: 30px;
font-weight: bold;
color: $tx;
margin-bottom: 20px;
display: block;
}
@mixin tag($bg, $color) {
display: inline-block;
padding: 4px 12px;
border-radius: 8px;
font-size: 22px;
font-weight: 500;
background: $bg;
color: $color;
}
@mixin flex-center {
display: flex;
align-items: center;
justify-content: center;
}
@import '../../../styles/mixins.scss';
.detail-page {
min-height: 100vh;
@@ -46,7 +17,7 @@
}
.balance-label {
font-size: 24px;
font-size: var(--tk-font-h2);
color: $tx2;
display: block;
margin-bottom: 8px;
@@ -54,7 +25,7 @@
.balance-value {
@include serif-number;
font-size: 60px;
font-size: var(--tk-font-hero);
font-weight: bold;
color: $pri;
display: block;
@@ -79,7 +50,7 @@
.stat-value {
@include serif-number;
font-size: 30px;
font-size: var(--tk-font-num);
font-weight: bold;
margin-bottom: 4px;
@@ -97,7 +68,7 @@
}
.stat-label {
font-size: 22px;
font-size: var(--tk-font-body);
color: $tx3;
}
@@ -135,7 +106,7 @@
}
.type-tab-text {
font-size: 28px;
font-size: var(--tk-font-body-lg);
color: $tx3;
.type-tab.active & {
@@ -182,7 +153,7 @@
.tx-badge-text {
font-family: 'Georgia', 'Times New Roman', serif;
font-size: 28px;
font-size: var(--tk-font-body-lg);
font-weight: bold;
.tx-badge-earn & {
@@ -204,7 +175,7 @@
}
.tx-desc {
font-size: 28px;
font-size: var(--tk-font-body-lg);
color: $tx;
display: block;
margin-bottom: 4px;
@@ -214,7 +185,7 @@
}
.tx-date {
font-size: 22px;
font-size: var(--tk-font-body);
color: $tx3;
display: block;
}
@@ -229,7 +200,7 @@
.tx-amount {
@include serif-number;
font-size: 32px;
font-size: var(--tk-font-num);
font-weight: bold;
margin-bottom: 4px;
@@ -244,6 +215,6 @@
.tx-remaining {
@include serif-number;
font-size: 22px;
font-size: var(--tk-font-body);
color: $tx3;
}

View File

@@ -1,34 +1,5 @@
@import '../../../styles/variables.scss';
@mixin serif-number {
font-family: 'Georgia', 'Times New Roman', serif;
font-variant-numeric: tabular-nums;
}
@mixin section-title {
font-family: 'Georgia', 'Times New Roman', serif;
font-size: 30px;
font-weight: bold;
color: $tx;
margin-bottom: 20px;
display: block;
}
@mixin tag($bg, $color) {
display: inline-block;
padding: 4px 12px;
border-radius: 8px;
font-size: 22px;
font-weight: 500;
background: $bg;
color: $color;
}
@mixin flex-center {
display: flex;
align-items: center;
justify-content: center;
}
@import '../../../styles/mixins.scss';
.exchange-page {
min-height: 100vh;
@@ -58,7 +29,7 @@
.product-icon-char {
font-family: 'Georgia', 'Times New Roman', serif;
font-size: 52px;
font-size: var(--tk-font-hero);
font-weight: bold;
color: #FFFFFF;
}
@@ -69,7 +40,7 @@
}
.product-name {
font-size: 32px;
font-size: var(--tk-font-num);
font-weight: bold;
color: $tx;
display: block;
@@ -113,19 +84,19 @@
}
.detail-label {
font-size: 28px;
font-size: var(--tk-font-body-lg);
color: $tx2;
}
.detail-value {
@include serif-number;
font-size: 28px;
font-size: var(--tk-font-body-lg);
color: $tx;
font-weight: bold;
&.detail-cost {
color: $pri;
font-size: 34px;
font-size: var(--tk-font-num-lg);
}
&.detail-sufficient {
@@ -148,12 +119,12 @@
.notice-title {
@include section-title;
font-size: 28px;
font-size: var(--tk-font-body-lg);
margin-bottom: 12px;
}
.notice-text {
font-size: 24px;
font-size: var(--tk-font-h2);
color: $tx3;
display: block;
line-height: 1.7;
@@ -182,19 +153,19 @@
}
.footer-cost-label {
font-size: 22px;
font-size: var(--tk-font-body);
color: $tx3;
}
.footer-cost-num {
@include serif-number;
font-size: 38px;
font-size: var(--tk-font-num-lg);
font-weight: bold;
color: $pri;
}
.footer-cost-unit {
font-size: 22px;
font-size: var(--tk-font-body);
color: $tx2;
margin-left: 4px;
}
@@ -212,7 +183,7 @@
}
.confirm-btn-text {
font-size: 30px;
font-size: var(--tk-font-num);
color: white;
font-weight: bold;
}

View File

@@ -1,34 +1,5 @@
@import '../../../styles/variables.scss';
@mixin serif-number {
font-family: 'Georgia', 'Times New Roman', serif;
font-variant-numeric: tabular-nums;
}
@mixin section-title {
font-family: 'Georgia', 'Times New Roman', serif;
font-size: 30px;
font-weight: bold;
color: $tx;
margin-bottom: 20px;
display: block;
}
@mixin tag($bg, $color) {
display: inline-block;
padding: 4px 12px;
border-radius: 8px;
font-size: 22px;
font-weight: 500;
background: $bg;
color: $color;
}
@mixin flex-center {
display: flex;
align-items: center;
justify-content: center;
}
@import '../../../styles/mixins.scss';
.orders-page {
min-height: 100vh;
@@ -66,7 +37,7 @@
}
.status-tab-text {
font-size: 28px;
font-size: var(--tk-font-body-lg);
color: $tx3;
.status-tab.active & {
@@ -98,7 +69,7 @@
.order-product {
font-family: 'Georgia', 'Times New Roman', serif;
font-size: 28px;
font-size: var(--tk-font-body-lg);
font-weight: bold;
color: $tx;
flex: 1;
@@ -116,7 +87,7 @@
}
.order-status-text {
font-size: 22px;
font-size: var(--tk-font-body);
font-weight: bold;
}
@@ -132,13 +103,13 @@
}
.order-row-label {
font-size: 26px;
font-size: var(--tk-font-h1);
color: $tx3;
}
.order-row-value {
@include serif-number;
font-size: 26px;
font-size: var(--tk-font-h1);
color: $tx;
&.order-cost {
@@ -158,14 +129,14 @@
}
.qrcode-label {
font-size: 24px;
font-size: var(--tk-font-h2);
color: $tx3;
margin-right: 8px;
}
.qrcode-value {
@include serif-number;
font-size: 24px;
font-size: var(--tk-font-h2);
color: $pri-d;
font-weight: bold;
flex: 1;
@@ -175,7 +146,7 @@
}
.qrcode-tap {
font-size: 22px;
font-size: var(--tk-font-body);
color: $pri;
margin-left: 8px;
flex-shrink: 0;