Skip to content

Commit 8b6326b

Browse files
authored
feat(theme): 升级8月份主题的微调,修订dialog 样式的鸿蒙适配等 (#3351)
* feat: 升级到最新的主题规范 * feat: 修复dialog暗黑模式背景问题 * feat: dialog 鸿蒙暗黑适配 * feat: 调整暗黑色值
1 parent dcfd2f0 commit 8b6326b

File tree

7 files changed

+206
-117
lines changed

7 files changed

+206
-117
lines changed

src/packages/configprovider/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ export type NutCSSVariables =
458458
| 'nutuiDialogMaxHeight'
459459
| 'nutuiDialogMinHeight'
460460
| 'nutuiDialogBorderRadius'
461+
| 'nutuiDialogBackground'
461462
| 'nutuiDialogContentMargin'
462463
| 'nutuiDialogContentMaxHeight'
463464
| 'nutuiDialogContentLineHeight'

src/packages/dialog/dialog.scss

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
&-outer {
1919
position: fixed;
2020
max-height: 100%;
21-
background-color: $white;
21+
background-color: $dialog-background;
2222
transition:
2323
transform 0.2s,
2424
-webkit-transform 0.2s;
@@ -130,12 +130,20 @@
130130
&-cancel.nut-dialog-footer-cancel {
131131
margin-right: $dialog-footer-cancel-margin-right;
132132
background: $dialog-footer-cancel-bg;
133+
color: $button-default-color;
134+
.nut-button-children {
135+
color: $button-default-color;
136+
}
133137
}
134138

135139
&-ok {
136140
max-width: $dialog-footer-ok-max-width;
137141
font-weight: $font-weight-bold;
142+
.nut-button-children {
143+
font-weight: $font-weight-bold;
144+
}
138145
}
146+
139147
&-block {
140148
&.nut-button {
141149
min-width: 100%;

src/styles/theme-dark.scss

Lines changed: 90 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -18,82 +18,48 @@ page {
1818
--nutui-brand-stop-1: #ff475d; // 渐变色起
1919
--nutui-brand-stop-2: #fa3725; // 渐变色止
2020

21-
// 品牌颜色语义化
22-
// 品牌主色调默认态,主要功能控件的背景、边框、镂空状态下的文字等
23-
--nutui-color-primary: var(--nutui-brand-6);
24-
// 品牌渐变色左端
25-
--nutui-color-primary-stop-1: var(--nutui-brand-stop-1);
26-
// 品牌渐变色右端
27-
--nutui-color-primary-stop-2: var(--nutui-brand-stop-2);
28-
// 品牌主色调或其他深色背景下的文字
29-
--nutui-color-primary-text: var(--nutui-color-background-gray-1);
30-
// 品牌主色调点击态,背景、边框、镂空状态下的文字
31-
--nutui-color-primary-pressed: var(--nutui-brand-7);
32-
// 品牌主色调禁用态,背景、边框、镂空状态下的文字
33-
--nutui-color-primary-disabled: var(--nutui-color-content-gray-1);
34-
// 品牌主色调特殊禁用态,通过操作后可转位默认态
35-
--nutui-color-primary-disabled-special: var(--nutui-brand-3);
36-
// 品牌主色调镂空背景点击态
37-
--nutui-color-primary-light-pressed: var(--nutui-brand-1);
38-
--nutui-color-primary-specialdisabled: var(--nutui-red-3);
39-
4021
// service color
41-
--nutui-golden-1: #292725;
42-
--nutui-golden-2: #4d4134;
43-
--nutui-golden-3: #c59463;
44-
--nutui-golden-4: #d18e54;
22+
--nutui-golden-1: #fff4e8;
23+
--nutui-golden-2: rgba(184, 124, 63, 0.04);
24+
--nutui-golden-3: rgba(191, 130, 66, 0.2);
25+
--nutui-golden-4: #b87c3f;
26+
--nutui-golden-5: #4d3b2a;
27+
--nutui-golden-6: #33271c;
28+
--nutui-golden-7: #ccb8a3;
4529

4630
--nutui-golden-stop-1: #fff9f0;
4731
--nutui-golden-stop-2: #ffe3c2;
4832

49-
// service color 语义化
50-
--nutui-color-service: var(--nutui-golden-1);
51-
--nutui-color-service-border: var(--nutui-golden-2);
52-
--nutui-color-service-pressed: var(--nutui-golden-4);
53-
--nutui-color-service-stop-1: var(--nutui-golden-stop-1);
54-
--nutui-color-service-stop-2: var(--nutui-golden-stop-2);
55-
--nutui-color-service-text: var(--nutui-golden-3);
56-
5733
// success color
5834
--nutui-green-1: #1f2920;
5935
--nutui-green-2: #32c241;
6036
--nutui-green-3: #12b222;
6137

62-
// success color 语义化
63-
--nutui-color-success: var(--nutui-green-2); // 深背景
64-
--nutui-color-success-light: var(--nutui-green-1); // 浅背景
65-
--nutui-color-success-pressed: var(--nutui-green-3); // 文字
66-
67-
// danger color
68-
--nutui-red-1: #2e2526;
69-
--nutui-red-2: #ff3344;
70-
--nutui-red-3: #ff3344;
71-
--nutui-red-6: #ff3b3b;
38+
// danger color 发现不一致 TODO
7239

73-
// danger color 语义化
74-
--nutui-color-danger: var(--nutui-red-2); // 背景或文字
75-
--nutui-color-danger-light: var(--nutui-red-1); // 背景
40+
// red color
41+
--nutui-red-1: #4c1c20;
42+
--nutui-red-2: #621a20;
43+
--nutui-red-3: #603840;
44+
--nutui-red-4: #893f49;
45+
--nutui-red-5: #bc3139;
46+
--nutui-red-6: #bc3139;
47+
--nutui-red-7: #ed3b34;
48+
--nutui-red-8: #ff5144;
49+
--nutui-red-9: #ff9382;
50+
--nutui-red-10: #ffccbf;
51+
--nutui-red-11: #ffe7e0;
7652

7753
// warning color
7854
--nutui-yellow-1: #29271f;
7955
--nutui-yellow-2: #faaf00;
80-
--nutui-yellow-3: #c47600; //todo
81-
82-
// warning color 语义化
83-
--nutui-color-warning: var(--nutui-yellow-2); // 深背景
84-
--nutui-color-warning-light: var(--nutui-yellow-1); // 浅背景
85-
--nutui-color-warning-pressed: var(--nutui-yellow-3); // 文字
56+
--nutui-yellow-3: #cc8500;
8657

8758
// info color
8859
--nutui-blue-1: #23292e;
8960
--nutui-blue-2: #3385ff;
9061

91-
// info color 语义化
92-
--nutui-color-info: var(--nutui-blue-2); // 背景或文字,链接色
93-
--nutui-color-info-light: var(--nutui-blue-1); // 背景
94-
9562
--nutui-secondary-1: #14cc33; // 辅助色
96-
--nutui-color-text-link: var(--nutui-blue-2);
9763

9864
// 背景色
9965
// 卡片背景色
@@ -102,6 +68,8 @@ page {
10268
--nutui-gray-2: #141414;
10369
// 页面基底色,用于卡片式页面的兜底,永远置于页面最底层。
10470
--nutui-gray-3: #0a0a0a;
71+
// 组件背景色,2025年新增
72+
--nutui-gray-9: #333333;
10573
// 文字色
10674
// 四级文字色,不可操作内容色,用于预置内容、无效内容、特殊不可点击按钮、组件边框线等。
10775
--nutui-gray-4: #666666;
@@ -120,7 +88,7 @@ page {
12088
--nutui-black-2: rgba(0, 0, 0, 0.1);
12189
// 线条色
12290
// 间隔线/容错线,用于结构或信息分割
123-
--nutui-black-3: rgba(255, 255, 255, 0.06);
91+
--nutui-black-3: rgba(255, 255, 255, 0.08);
12492
--nutui-black-4: rgba(20, 20, 20, 0.1);
12593
--nutui-black-5: rgba(20, 20, 20, 0.2);
12694
--nutui-black-6: rgba(20, 20, 20, 0.3);
@@ -150,6 +118,69 @@ page {
150118
--nutui-white-12: rgba(31, 31, 31, 0.9);
151119
// --nutui-white-13: rgba(255, 255, 255, 1);
152120

121+
// 品牌颜色语义化
122+
// 品牌主色调默认态,主要功能控件的背景、边框、镂空状态下的文字等
123+
--nutui-color-primary: var(--nutui-brand-6);
124+
// 品牌渐变色左端
125+
--nutui-color-primary-stop-1: var(--nutui-brand-stop-1);
126+
// 品牌渐变色右端
127+
--nutui-color-primary-stop-2: var(--nutui-brand-stop-2);
128+
// 品牌主色调或其他深色背景下的文字
129+
--nutui-color-primary-text: var(--nutui-color-background-gray-1);
130+
// 品牌主色调点击态,背景、边框、镂空状态下的文字
131+
--nutui-color-primary-pressed: var(--nutui-red-7);
132+
// 品牌主色调禁用态,背景、边框、镂空状态下的文字
133+
--nutui-color-primary-disabled: var(--nutui-color-content-gray-1);
134+
// 品牌主色调特殊禁用态,通过操作后可转位默认态
135+
--nutui-color-primary-disabled-special: var(--nutui-red-3);
136+
// 2025 新增
137+
--nutui-color-primary-light: var(--nutui-brand-1);
138+
// 品牌主色调镂空背景点击态
139+
--nutui-color-primary-light-pressed: var(--nutui-red-2);
140+
// 看上去命名和上边重复,去掉
141+
// --nutui-color-primary-specialdisabled: var(--nutui-red-3);
142+
143+
// service color 语义化
144+
// 金色背景
145+
--nutui-color-service: var(--nutui-golden-1);
146+
// 填充标签边框
147+
--nutui-color-service-border-1: var(--nutui-golden-2);
148+
// 线框标签边框
149+
--nutui-color-service-border-2: var(--nutui-golden-3);
150+
// 废弃
151+
// --nutui-color-service-border: var(--nutui-golden-2);
152+
--nutui-color-service-pressed: var(--nutui-golden-4);
153+
// 金色文字
154+
--nutui-color-service-text: var(--nutui-golden-4);
155+
// 金色按钮背景
156+
--nutui-color-service-btn-bg: var(--nutui-golden-5);
157+
// 金色按钮点击态背景
158+
--nutui-color-service-btn-bg-pressed: var(--nutui-golden-6);
159+
// 金色按钮文字
160+
--nutui-color-service-btn-text: var(--nutui-golden-7);
161+
162+
--nutui-color-service-stop-1: var(--nutui-golden-stop-1);
163+
--nutui-color-service-stop-2: var(--nutui-golden-stop-2);
164+
165+
// success color 语义化
166+
--nutui-color-success: var(--nutui-green-2); // 深背景
167+
--nutui-color-success-light: var(--nutui-green-1); // 浅背景
168+
--nutui-color-success-pressed: var(--nutui-green-3); // 文字
169+
170+
// danger color 语义化,待办,看上去目前非常的独立 @周峯
171+
--nutui-color-danger: var(--nutui-red-2); // 背景或文字
172+
--nutui-color-danger-light: var(--nutui-red-1); // 背景
173+
174+
// info color 语义化
175+
--nutui-color-info: var(--nutui-blue-2); // 背景或文字,链接色
176+
--nutui-color-info-light: var(--nutui-blue-1); // 背景
177+
--nutui-color-text-link: var(--nutui-blue-2);
178+
179+
// warning color 语义化
180+
--nutui-color-warning: var(--nutui-yellow-2); // 深背景
181+
--nutui-color-warning-light: var(--nutui-yellow-1); // 浅背景
182+
--nutui-color-warning-pressed: var(--nutui-yellow-3); // 文字
183+
153184
// 文字颜色值 语义化
154185
--nutui-color-content-gray-1: var(--nutui-gray-4);
155186
--nutui-color-content-gray-2: var(--nutui-gray-5);
@@ -168,12 +199,15 @@ page {
168199
--nutui-color-background-gray-1: var(--nutui-gray-1);
169200
--nutui-color-background-gray-2: var(--nutui-gray-2);
170201
--nutui-color-background-gray-3: var(--nutui-gray-3);
202+
--nutui-color-background-gray-4: var(--nutui-gray-9);
171203
// 页面背景
172204
--nutui-color-background: var(--nutui-color-background-gray-3);
173205
// 卡片背景
174206
--nutui-color-background-overlay: var(--nutui-color-background-gray-1);
175207
// 卡片内容器背景
176208
--nutui-color-background-sunken: var(--nutui-color-background-gray-2);
209+
// 组件背景,2025年新增
210+
--nutui-color-background-component: var(--nutui-color-background-gray-4);
177211

178212
// 蒙层颜色值 语义化
179213
--nutui-color-mask-gray-1: var(--nutui-black-2);

0 commit comments

Comments
 (0)