Skip to content

Commit 70a576d

Browse files
committed
style: add css themes vars
1 parent 28fdf9a commit 70a576d

File tree

5 files changed

+28
-14
lines changed

5 files changed

+28
-14
lines changed

docs/docs/guide/expand/editor/theme.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ sidebar_position: 9
5050
- `--color-text-dark`: 文字颜色(dark)
5151
- `--color-text-light`: 文字颜色(light)
5252
- `--color-text-reverse`: 反色情况下,文字颜色
53-
- `--color-text-regular`: 文字颜色(regular)
5453
- `--color-text-disabled`: 禁用态文字颜色
5554

5655
#### 字段和边框颜色
@@ -109,10 +108,20 @@ sidebar_position: 9
109108
#### 其他变量
110109

111110
- `--workspace-sub-top-area-height`: 应用级二级 topArea 高度
111+
- `--top-area-height`: 顶部区域的高度
112112
- `--workspace-sub-top-area-margin`: 应用级二级 topArea margin
113113
- `--workspace-sub-top-area-padding`: 应用级二级 topArea padding
114114
- `--workspace-left-area-width`: 应用级 leftArea width
115115
- `--left-area-width`: leftArea width
116+
- `--simulator-top-distance`: simulator 距离容器顶部的距离
117+
- `--simulator-bottom-distance`: simulator 距离容器底部的距离
118+
- `--simulator-left-distance`: simulator 距离容器左边的距离
119+
- `--simulator-right-distance`: simulator 距离容器右边的距离
120+
- `--toolbar-padding`: toolbar 的 padding
121+
- `--toolbar-height`: toolbar 的高度
122+
- `--pane-title-height`: 面板标题高度
123+
- `--pane-title-font-size`: 面板标题字体大小
124+
- `--pane-title-padding`: 面板标题边距
116125

117126

118127

packages/designer/src/builtin-simulator/host.less

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@
7373
}
7474

7575
&-device-default {
76-
top: 16px;
77-
right: 16px;
78-
bottom: 16px;
79-
left: 16px;
76+
top: var(--simulator-top-distance, 16px);
77+
right: var(--simulator-right-distance, 16px);
78+
bottom: var(--simulator-bottom-distance, 16px);
79+
left: var(--simulator-left-distance, 16px);
8080
width: auto;
8181
box-shadow: 0 1px 4px 0 var(--color-block-background-shallow, rgba(31, 50, 88, 0.125));
8282
}

packages/editor-skeleton/src/layouts/theme.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
--color-text-dark: darken(@dark-alpha-3, 10%);
2828
--color-text-light: lighten(@dark-alpha-3, 10%);
2929
--color-text-reverse: @white-alpha-2;
30-
--color-text-regular: @normal-alpha-2;
3130
--color-text-disabled: @gray-light;
3231

3332
--color-field-label: @dark-alpha-4;
@@ -87,4 +86,5 @@
8786
--color-function-error-light: lighten(@brand-danger, 10%);
8887
--color-function-purple: rgb(144, 94, 190);
8988
--color-function-brown: #7b605b;
89+
--color-text-regular: @normal-alpha-2;
9090
}

packages/editor-skeleton/src/layouts/workbench.less

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,16 @@ body {
6666
}
6767
}
6868
> .lc-panel-title {
69-
height: 48px;
70-
font-size: 16px;
71-
padding: 0 15px;
69+
height: var(--pane-title-height, 48px);
70+
font-size: var(--pane-title-font-size, 16px);
71+
padding: var(--pane-title-padding, 0 15px);
7272
color: var(--color-title, #0f1726);
7373
font-weight: bold;
7474
}
7575

7676
.lc-panel-body {
7777
position: absolute;
78-
top: 48px;
78+
top: var(--pane-title-height, 48px);
7979
bottom: 0;
8080
left: 0;
8181
right: 0;
@@ -234,7 +234,7 @@ body {
234234
.lc-pane-icon-close {
235235
position: absolute;
236236
right: 16px;
237-
top: 14px;
237+
top: calc(var(--pane-title-height, 48px) / 2 - 10px);
238238
height: auto;
239239
z-index: 2;
240240
.next-icon {
@@ -247,7 +247,7 @@ body {
247247
.lc-pane-icon-float {
248248
position: absolute;
249249
right: 38px;
250-
top: 14px;
250+
top: calc(var(--pane-title-height, 48px) / 2 - 10px);
251251
height: auto;
252252
z-index: 2;
253253
svg {
@@ -367,7 +367,7 @@ body {
367367
display: flex;
368368
height: var(--toolbar-height);
369369
background-color: var(--color-toolbar-background, var(--color-pane-background));
370-
padding: 8px 16px;
370+
padding: var(--toolbar-padding, 8px 16px);
371371
.lc-toolbar-center {
372372
display: flex;
373373
justify-content: center;
@@ -457,7 +457,7 @@ body {
457457
display: flex;
458458
height: var(--toolbar-height);
459459
background-color: var(--color-toolbar-background, var(--color-pane-background));
460-
padding: 8px 16px;
460+
padding: var(--toolbar-padding, 8px 16px);
461461
.lc-toolbar-center {
462462
display: flex;
463463
justify-content: center;

packages/types/src/shell/type/widget-base-config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ export interface IPublicTypeWidgetBaseConfig {
1515
props?: Record<string, any>;
1616
content?: any;
1717
contentProps?: Record<string, any>;
18+
19+
/**
20+
* 优先级,值越小,优先级越高,优先级高的会排在前面
21+
*/
22+
index?: number;
1823
}
1924

2025
export interface IPublicTypePanelDockConfig extends IPublicTypeWidgetBaseConfig {

0 commit comments

Comments
 (0)