@fibrae/semi-ui-svelte 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/README.zh-CN.md +8 -4
- package/dist/components/anchor/interface.d.ts +14 -0
- package/dist/components/audio-player/interface.d.ts +5 -0
- package/dist/components/auto-complete/interface.d.ts +29 -0
- package/dist/components/avatar/interface.d.ts +24 -0
- package/dist/components/backtop/interface.d.ts +2 -0
- package/dist/components/badge/interface.d.ts +7 -0
- package/dist/components/banner/interface.d.ts +7 -0
- package/dist/components/breadcrumb/interface.d.ts +10 -0
- package/dist/components/button/interface.d.ts +18 -0
- package/dist/components/calendar/interface.d.ts +16 -0
- package/dist/components/card/interface.d.ts +18 -0
- package/dist/components/carousel/interface.d.ts +16 -0
- package/dist/components/cascader/interface.d.ts +57 -0
- package/dist/components/checkbox/interface.d.ts +19 -0
- package/dist/components/code-highlight/interface.d.ts +3 -0
- package/dist/components/collapse/interface.d.ts +16 -0
- package/dist/components/collapsible/interface.d.ts +10 -0
- package/dist/components/color-picker/interface.d.ts +10 -0
- package/dist/components/config-provider/interface.d.ts +7 -0
- package/dist/components/cropper/interface.d.ts +11 -0
- package/dist/components/date-picker/interface.d.ts +47 -0
- package/dist/components/descriptions/interface.d.ts +6 -0
- package/dist/components/divider/interface.d.ts +4 -0
- package/dist/components/dropdown/interface.d.ts +8 -0
- package/dist/components/empty/interface.d.ts +7 -0
- package/dist/components/feedback/interface.d.ts +16 -0
- package/dist/components/float-button/interface.d.ts +14 -0
- package/dist/components/form/interface.d.ts +47 -0
- package/dist/components/grid/interface.d.ts +13 -0
- package/dist/components/highlight/interface.d.ts +7 -0
- package/dist/components/hot-keys/interface.d.ts +3 -0
- package/dist/components/image/interface.d.ts +59 -0
- package/dist/components/input/interface.d.ts +67 -0
- package/dist/components/input-number/interface.d.ts +24 -0
- package/dist/components/json-viewer/interface.d.ts +7 -0
- package/dist/components/layout/interface.d.ts +3 -0
- package/dist/components/list/interface.d.ts +18 -0
- package/dist/components/locale/interface.d.ts +4 -0
- package/dist/components/lottie/interface.d.ts +2 -0
- package/dist/components/markdown-render/interface.d.ts +5 -0
- package/dist/components/modal/interface.d.ts +29 -0
- package/dist/components/navigation/interface.d.ts +47 -0
- package/dist/components/overflow-list/interface.d.ts +11 -0
- package/dist/components/pagination/interface.d.ts +12 -0
- package/dist/components/pincode/interface.d.ts +8 -0
- package/dist/components/popconfirm/interface.d.ts +12 -0
- package/dist/components/popover/interface.d.ts +30 -0
- package/dist/components/progress/interface.d.ts +13 -0
- package/dist/components/radio/interface.d.ts +22 -0
- package/dist/components/rating/interface.d.ts +12 -0
- package/dist/components/resizable/interface.d.ts +30 -0
- package/dist/components/scroll-list/interface.d.ts +6 -0
- package/dist/components/select/interface.d.ts +63 -0
- package/dist/components/side-sheet/interface.d.ts +19 -0
- package/dist/components/skeleton/interface.d.ts +7 -0
- package/dist/components/slider/interface.d.ts +23 -0
- package/dist/components/space/interface.d.ts +4 -0
- package/dist/components/spin/interface.d.ts +7 -0
- package/dist/components/steps/interface.d.ts +9 -0
- package/dist/components/switch/interface.d.ts +7 -0
- package/dist/components/table/interface.d.ts +48 -0
- package/dist/components/tabs/interface.d.ts +29 -0
- package/dist/components/tag/interface.d.ts +22 -0
- package/dist/components/tag-input/interface.d.ts +29 -0
- package/dist/components/time-picker/interface.d.ts +31 -0
- package/dist/components/timeline/interface.d.ts +5 -0
- package/dist/components/tooltip/interface.d.ts +20 -0
- package/dist/components/transfer/interface.d.ts +18 -0
- package/dist/components/tree/interface.d.ts +45 -0
- package/dist/components/tree-select/interface.d.ts +55 -0
- package/dist/components/typography/interface.d.ts +33 -0
- package/dist/components/upload/interface.d.ts +64 -0
- package/dist/components/user-guide/interface.d.ts +15 -0
- package/dist/components/video-player/interface.d.ts +22 -0
- package/docs/advanced/dark-mode.md +288 -0
- package/docs/basic/button.md +605 -0
- package/docs/basic/divider.md +103 -0
- package/docs/basic/float-button.md +246 -0
- package/docs/basic/grid.md +427 -0
- package/docs/basic/layout.md +459 -0
- package/docs/basic/resizable.md +584 -0
- package/docs/basic/space.md +163 -0
- package/docs/basic/tokens.md +425 -0
- package/docs/basic/typography.md +615 -0
- package/docs/changes-from-semi.md +105 -0
- package/docs/ecosystem/tailwind.md +210 -0
- package/docs/experience/accessibility.md +82 -0
- package/docs/experience/content-guidelines.md +819 -0
- package/docs/experience/internationalization.md +7 -0
- package/docs/feedback/banner.md +198 -0
- package/docs/feedback/feedback.md +294 -0
- package/docs/feedback/notification.md +401 -0
- package/docs/feedback/popconfirm.md +243 -0
- package/docs/feedback/progress.md +389 -0
- package/docs/feedback/skeleton.md +388 -0
- package/docs/feedback/spin.md +172 -0
- package/docs/feedback/toast.md +393 -0
- package/docs/input/auto-complete.md +399 -0
- package/docs/input/cascader.md +1558 -0
- package/docs/input/checkbox.md +408 -0
- package/docs/input/color-picker.md +175 -0
- package/docs/input/date-picker.md +942 -0
- package/docs/input/form.md +2550 -0
- package/docs/input/input-number.md +451 -0
- package/docs/input/input.md +640 -0
- package/docs/input/pincode.md +191 -0
- package/docs/input/radio.md +337 -0
- package/docs/input/rating.md +214 -0
- package/docs/input/select.md +1230 -0
- package/docs/input/slider.md +347 -0
- package/docs/input/switch.md +206 -0
- package/docs/input/tag-input.md +465 -0
- package/docs/input/time-picker.md +358 -0
- package/docs/input/transfer.md +1061 -0
- package/docs/input/tree-select.md +1300 -0
- package/docs/input/upload.md +1811 -0
- package/docs/llms.txt +147 -0
- package/docs/navigation/anchor.md +377 -0
- package/docs/navigation/backtop.md +100 -0
- package/docs/navigation/breadcrumb.md +284 -0
- package/docs/navigation/navigation.md +851 -0
- package/docs/navigation/pagination.md +217 -0
- package/docs/navigation/steps.md +315 -0
- package/docs/navigation/tabs.md +754 -0
- package/docs/navigation/tree.md +1956 -0
- package/docs/other/config-provider.md +599 -0
- package/docs/other/locale.md +353 -0
- package/docs/plus/audio-player.md +155 -0
- package/docs/plus/code-highlight.md +150 -0
- package/docs/plus/drag-move.md +214 -0
- package/docs/plus/hot-keys.md +174 -0
- package/docs/plus/json-viewer.md +392 -0
- package/docs/plus/lottie.md +176 -0
- package/docs/plus/markdown-render.md +240 -0
- package/docs/plus/video-player.md +325 -0
- package/docs/show/avatar.md +475 -0
- package/docs/show/badge.md +276 -0
- package/docs/show/calendar.md +352 -0
- package/docs/show/card.md +485 -0
- package/docs/show/carousel.md +592 -0
- package/docs/show/collapse.md +289 -0
- package/docs/show/collapsible.md +216 -0
- package/docs/show/cropper.md +285 -0
- package/docs/show/descriptions.md +325 -0
- package/docs/show/dropdown.md +466 -0
- package/docs/show/empty.md +225 -0
- package/docs/show/highlight.md +144 -0
- package/docs/show/image.md +433 -0
- package/docs/show/list.md +927 -0
- package/docs/show/modal.md +517 -0
- package/docs/show/overflow-list.md +272 -0
- package/docs/show/popover.md +534 -0
- package/docs/show/scroll-list.md +156 -0
- package/docs/show/side-sheet.md +274 -0
- package/docs/show/table.md +5437 -0
- package/docs/show/tag.md +428 -0
- package/docs/show/timeline.md +277 -0
- package/docs/show/tooltip.md +442 -0
- package/docs/show/user-guide.md +419 -0
- package/docs/start/getting-started.md +234 -0
- package/docs/start/introduction.md +57 -0
- package/docs/start/overview.md +21 -0
- package/package.json +5 -4
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Space
|
|
2
|
+
|
|
3
|
+
> Set the spacing between components.
|
|
4
|
+
|
|
5
|
+
Package: `@fibrae/semi-ui-svelte`. Web page: https://semi-design-next.pages.dev/en-US/svelte/basic/space/
|
|
6
|
+
|
|
7
|
+
## Demos
|
|
8
|
+
|
|
9
|
+
### How to import
|
|
10
|
+
|
|
11
|
+
```svelte
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { Space } from '@fibrae/semi-ui-svelte';
|
|
14
|
+
</script>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Basic Usage
|
|
18
|
+
|
|
19
|
+
```svelte
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import { Button, Space, Switch } from '@fibrae/semi-ui-svelte';
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<Space>
|
|
25
|
+
<Switch aria-label="示例开关" checked />
|
|
26
|
+
<Button type="secondary">次要</Button>
|
|
27
|
+
<Button type="tertiary">第三</Button>
|
|
28
|
+
<Button type="warning">警告</Button>
|
|
29
|
+
</Space>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Alignment
|
|
33
|
+
|
|
34
|
+
You can use `align` to set the alignment, optional: `start`, `center` (default), `end`, `baseline`.
|
|
35
|
+
|
|
36
|
+
```svelte
|
|
37
|
+
<script lang="ts">
|
|
38
|
+
import { Button, Space, Tag } from '@fibrae/semi-ui-svelte';
|
|
39
|
+
|
|
40
|
+
const aligns = ['start', 'center', 'end', 'baseline'] as const;
|
|
41
|
+
const boxStyle = 'width: 80px; height: 100px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--semi-color-border); border-radius: 3px';
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<Space vertical>
|
|
45
|
+
{#each aligns as align (align)}
|
|
46
|
+
<Space {align}>
|
|
47
|
+
<div style={boxStyle}>文本</div>
|
|
48
|
+
<Button theme="solid" type="primary">按钮</Button>
|
|
49
|
+
<Tag color="green" size="large">标签</Tag>
|
|
50
|
+
</Space>
|
|
51
|
+
{/each}
|
|
52
|
+
</Space>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Spacing
|
|
56
|
+
|
|
57
|
+
You can use `spacing` to set the spacing size, optional: `tight` (8px, default), `medium` (16px), `loose` (24px), and allow to pass in number to customize the spacing size, and also support to pass in array to set the horizontal and vertical spacing at the same time.
|
|
58
|
+
|
|
59
|
+
```svelte
|
|
60
|
+
<script lang="ts">
|
|
61
|
+
import { Button, Space, Tabs } from '@fibrae/semi-ui-svelte';
|
|
62
|
+
|
|
63
|
+
const tabList = [
|
|
64
|
+
{ itemKey: '1', tab: 'tight' },
|
|
65
|
+
{ itemKey: '2', tab: 'medium' },
|
|
66
|
+
{ itemKey: '3', tab: 'loose' },
|
|
67
|
+
{ itemKey: '4', tab: 'array' },
|
|
68
|
+
];
|
|
69
|
+
const fourButtons = [1, 2, 3, 4];
|
|
70
|
+
const tenButtons = Array.from({ length: 10 }, (_, index) => index);
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<Tabs {tabList} type="line">
|
|
74
|
+
{#snippet panel(pane)}
|
|
75
|
+
{#if pane.itemKey === '1'}
|
|
76
|
+
<Space spacing="tight" style="margin-block-start: 15px">
|
|
77
|
+
{#each fourButtons as item (item)}
|
|
78
|
+
<Button theme="solid" type="primary">按钮</Button>
|
|
79
|
+
{/each}
|
|
80
|
+
</Space>
|
|
81
|
+
{:else if pane.itemKey === '2'}
|
|
82
|
+
<Space spacing="medium" style="margin-block-start: 15px">
|
|
83
|
+
{#each fourButtons as item (item)}
|
|
84
|
+
<Button theme="solid" type="primary">按钮</Button>
|
|
85
|
+
{/each}
|
|
86
|
+
</Space>
|
|
87
|
+
{:else if pane.itemKey === '3'}
|
|
88
|
+
<Space spacing="loose" style="margin-block-start: 15px">
|
|
89
|
+
{#each fourButtons as item (item)}
|
|
90
|
+
<Button theme="solid" type="primary">按钮</Button>
|
|
91
|
+
{/each}
|
|
92
|
+
</Space>
|
|
93
|
+
{:else}
|
|
94
|
+
<Space spacing={[8, 16]} style="margin-block-start: 15px" wrap>
|
|
95
|
+
{#each tenButtons as item (item)}
|
|
96
|
+
<Button theme="solid" type="primary">按钮</Button>
|
|
97
|
+
{/each}
|
|
98
|
+
</Space>
|
|
99
|
+
{/if}
|
|
100
|
+
{/snippet}
|
|
101
|
+
</Tabs>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Direction
|
|
105
|
+
|
|
106
|
+
You can use `vertical` to set whether the spacing is vertical, the default is false.
|
|
107
|
+
|
|
108
|
+
```svelte
|
|
109
|
+
<script lang="ts">
|
|
110
|
+
import { Button, Space } from '@fibrae/semi-ui-svelte';
|
|
111
|
+
|
|
112
|
+
const fourButtons = [1, 2, 3, 4];
|
|
113
|
+
</script>
|
|
114
|
+
|
|
115
|
+
<Space vertical>
|
|
116
|
+
{#each fourButtons as item (item)}
|
|
117
|
+
<Button theme="solid" type="primary">按钮</Button>
|
|
118
|
+
{/each}
|
|
119
|
+
</Space>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Wrap
|
|
123
|
+
|
|
124
|
+
When the spacing is horizontal, you can use `wrap` to set whether to wrap automatically, the default is false.
|
|
125
|
+
|
|
126
|
+
```svelte
|
|
127
|
+
<script lang="ts">
|
|
128
|
+
import { Button, Space } from '@fibrae/semi-ui-svelte';
|
|
129
|
+
|
|
130
|
+
const tenButtons = Array.from({ length: 10 }, (_, index) => index);
|
|
131
|
+
</script>
|
|
132
|
+
|
|
133
|
+
<Space wrap>
|
|
134
|
+
{#each tenButtons as item (item)}
|
|
135
|
+
<Button theme="solid" type="secondary">按钮</Button>
|
|
136
|
+
{/each}
|
|
137
|
+
</Space>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## API Reference
|
|
141
|
+
|
|
142
|
+
Space renders `children` directly without wrapping them. `class`, `style` and other native attributes and listeners land on the root `div`. A numeric `spacing` is output in pixels, and `column-gap` or `row-gap` in the `style` string take precedence over it.
|
|
143
|
+
|
|
144
|
+
**Props**
|
|
145
|
+
|
|
146
|
+
| Property | Description | Type | Default |
|
|
147
|
+
| - | - | - | - |
|
|
148
|
+
| align | Alignment: start, center, end or baseline. | `Align` | `"center"` |
|
|
149
|
+
| children | Children to space out. | `Snippet` | - |
|
|
150
|
+
| spacing | Spacing size: loose, medium, tight or a number of pixels. Pass a \[horizontal, vertical] array to set each direction. | `Spacing \| [Spacing, Spacing]` | `"tight"` |
|
|
151
|
+
| vertical | Whether the spacing is vertical. | `boolean` | `false` |
|
|
152
|
+
| wrap | Whether to wrap automatically. Only applies to horizontal spacing. | `boolean` | `false` |
|
|
153
|
+
|
|
154
|
+
## Design Tokens
|
|
155
|
+
|
|
156
|
+
The design token table of this component is on the web page: <https://semi-design-next.pages.dev/en-US/svelte/basic/space/>
|
|
157
|
+
|
|
158
|
+
## Changes from Semi Design
|
|
159
|
+
|
|
160
|
+
From the project release notes (written in Chinese). Your knowledge of Semi Design does not cover these.
|
|
161
|
+
|
|
162
|
+
- 不再展开 Fragment 与嵌套数组,条件兄弟切换不再重挂载有状态子组件;用户 `style` 的 `columnGap`、`rowGap` 始终优先于数字 `spacing`;破坏性(类型):`spacing` 数组类型收窄为 `[Spacing, Spacing]`,CardGroup 的 `spacing` 同步收窄。Vue:直接渲染默认插槽,不包裹子节点,数字 `spacing` 输出 `px`。
|
|
163
|
+
- Svelte:同 Vue,直接渲染 `children`,不包裹子节点;`style` 只接受字符串,使用方的 `gap` 优先。
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
# Tokens
|
|
2
|
+
|
|
3
|
+
> Semi Design Next Tokens
|
|
4
|
+
|
|
5
|
+
Package: `@fibrae/semi-ui-svelte`. Web page: https://semi-design-next.pages.dev/en-US/svelte/basic/tokens/
|
|
6
|
+
|
|
7
|
+
## Why use variables
|
|
8
|
+
|
|
9
|
+
Variables actually decouple the basic elements of design from specific styles. For designers, if the style of the product needs to be updated iteratively, for example, the dangerous function color, namely color danger, needs to be updated, they only need to modify its corresponding color default value to complete the UI iteration of the whole product. For R & D, in order to adapt to the iteration of product style update, design token can update the style of all components more quickly without modifying everywhere. This is why we need to pay special attention to using variables instead of fixed default values in the development process. If the style of the product is shared by multiple platforms, it can get twice the result with half the effort. In particular, for platforms with dark mode requirements, Semi Design Next's color variable is needed to achieve the effect of one click switching between light and dark. Therefore, here we will introduce the design token system of Semi Design Next in detail and how to use them.
|
|
10
|
+
|
|
11
|
+
## Basic color
|
|
12
|
+
|
|
13
|
+
A palette of 16 hues in gradient steps, 160 colors in total. In general, we use the color in the base color to further define the function color.
|
|
14
|
+
|
|
15
|
+
> **Attention**
|
|
16
|
+
>
|
|
17
|
+
> The colors of the AI general series are gradient colors implemented using linear-gradient(). They cannot be used as background-color values and need to be used as background-image or background values to be effective.
|
|
18
|
+
|
|
19
|
+
### Color conversion
|
|
20
|
+
|
|
21
|
+
## Functional color
|
|
22
|
+
|
|
23
|
+
From the basic color disk reference, including the interface background, text icons, links, stroke and other user interface elements.
|
|
24
|
+
|
|
25
|
+
### Primary color - primary
|
|
26
|
+
|
|
27
|
+
User interface main tone and interactive colors, usually used for main operation button, etc
|
|
28
|
+
|
|
29
|
+
| Variable | Light | Dark | Usage |
|
|
30
|
+
| - | - | - | - |
|
|
31
|
+
| `--semi-color-primary` | var(--semi-blue-5) | var(--semi-blue-5) | 主要颜色。仅在需要非常强调的情况下使用。 |
|
|
32
|
+
| `--semi-color-primary-hover` | var(--semi-blue-6) | var(--semi-blue-6) | 主要颜色悬浮态 |
|
|
33
|
+
| `--semi-color-primary-active` | var(--semi-blue-7) | var(--semi-blue-7) | 主要颜色激活态 |
|
|
34
|
+
| `--semi-color-primary-disabled` | var(--semi-blue-2) | var(--semi-blue-2) | 主要颜色禁用态 |
|
|
35
|
+
| `--semi-color-primary-light-default` | var(--semi-blue-0) | color-mix(in srgb, var(--semi-blue-5) 20%, transparent) | 浅版主要颜色(多用于背景)。仅在需要非常强调的情况下使用。 |
|
|
36
|
+
| `--semi-color-primary-light-hover` | var(--semi-blue-1) | color-mix(in srgb, var(--semi-blue-5) 30%, transparent) | 浅版主要颜色悬浮态 |
|
|
37
|
+
| `--semi-color-primary-light-active` | var(--semi-blue-2) | color-mix(in srgb, var(--semi-blue-5) 40%, transparent) | 浅版主要颜色激活态 |
|
|
38
|
+
|
|
39
|
+
### Secondary color - secondary
|
|
40
|
+
|
|
41
|
+
Secondary color - secondary
|
|
42
|
+
|
|
43
|
+
| Variable | Light | Dark | Usage |
|
|
44
|
+
| - | - | - | - |
|
|
45
|
+
| `--semi-color-secondary` | var(--semi-light-blue-5) | var(--semi-light-blue-5) | 次要颜色。强调作用次于主要颜色,但仍然具有强调作用。 |
|
|
46
|
+
| `--semi-color-secondary-hover` | var(--semi-light-blue-6) | var(--semi-light-blue-6) | 次要颜色悬浮态 |
|
|
47
|
+
| `--semi-color-secondary-active` | var(--semi-light-blue-7) | var(--semi-light-blue-7) | 次要颜色激活态 |
|
|
48
|
+
| `--semi-color-secondary-disabled` | var(--semi-light-blue-2) | var(--semi-light-blue-2) | 次要颜色禁用态 |
|
|
49
|
+
| `--semi-color-secondary-light-default` | var(--semi-light-blue-0) | color-mix(in srgb, var(--semi-light-blue-5) 20%, transparent) | 浅版次要颜色(多用于背景)。强调作用次于主要颜色,但仍然具有强调作用。 |
|
|
50
|
+
| `--semi-color-secondary-light-hover` | var(--semi-light-blue-1) | color-mix(in srgb, var(--semi-light-blue-5) 30%, transparent) | 浅版次要颜色悬浮态 |
|
|
51
|
+
| `--semi-color-secondary-light-active` | var(--semi-light-blue-2) | color-mix(in srgb, var(--semi-light-blue-5) 40%, transparent) | 浅版次要颜色激活态 |
|
|
52
|
+
|
|
53
|
+
### Tertiary color - tertiary
|
|
54
|
+
|
|
55
|
+
In the user interface, non emphasis color and interactive color are usually used for general and non emphasis function operation buttons
|
|
56
|
+
|
|
57
|
+
| Variable | Light | Dark | Usage |
|
|
58
|
+
| - | - | - | - |
|
|
59
|
+
| `--semi-color-tertiary` | var(--semi-grey-5) | var(--semi-grey-5) | 第三颜色,可以在页面上多次使用 |
|
|
60
|
+
| `--semi-color-tertiary-hover` | var(--semi-grey-6) | var(--semi-grey-6) | 第三颜色悬浮态 |
|
|
61
|
+
| `--semi-color-tertiary-active` | var(--semi-grey-7) | var(--semi-grey-7) | 第三颜色激活态 |
|
|
62
|
+
| `--semi-color-tertiary-light-default` | var(--semi-grey-0) | color-mix(in srgb, var(--semi-grey-5) 20%, transparent) | 浅版第三颜色(多用于背景),可以在页面上多次使用 |
|
|
63
|
+
| `--semi-color-tertiary-light-hover` | var(--semi-grey-1) | color-mix(in srgb, var(--semi-grey-5) 30%, transparent) | 浅版第三颜色悬浮态 |
|
|
64
|
+
| `--semi-color-tertiary-light-active` | var(--semi-grey-2) | color-mix(in srgb, var(--semi-grey-5) 40%, transparent) | 浅版第三颜色激活态 |
|
|
65
|
+
|
|
66
|
+
### Information - info
|
|
67
|
+
|
|
68
|
+
It is usually used to express objective and neutral information in the context with the above semantics
|
|
69
|
+
|
|
70
|
+
| Variable | Light | Dark | Usage |
|
|
71
|
+
| - | - | - | - |
|
|
72
|
+
| `--semi-color-info` | var(--semi-blue-5) | var(--semi-blue-5) | 信息色, 通常用于表达客观、中立信息 |
|
|
73
|
+
| `--semi-color-info-hover` | var(--semi-blue-6) | var(--semi-blue-6) | 信息色悬浮态 |
|
|
74
|
+
| `--semi-color-info-active` | var(--semi-blue-7) | var(--semi-blue-7) | 信息色激活态 |
|
|
75
|
+
| `--semi-color-info-disabled` | var(--semi-blue-2) | var(--semi-blue-2) | 信息色禁用态 |
|
|
76
|
+
| `--semi-color-info-light-default` | var(--semi-blue-0) | color-mix(in srgb, var(--semi-blue-5) 20%, transparent) | 浅版信息色(多用于背景),通常用于表达客观、中立信息 |
|
|
77
|
+
| `--semi-color-info-light-hover` | var(--semi-blue-1) | color-mix(in srgb, var(--semi-blue-5) 30%, transparent) | 浅版信息色悬浮态 |
|
|
78
|
+
| `--semi-color-info-light-active` | var(--semi-blue-2) | color-mix(in srgb, var(--semi-blue-5) 40%, transparent) | 浅版信息色激活态 |
|
|
79
|
+
|
|
80
|
+
### Success - success
|
|
81
|
+
|
|
82
|
+
It is usually used to express the success, completion and opening status, and is used in scenarios with the above semantics
|
|
83
|
+
|
|
84
|
+
| Variable | Light | Dark | Usage |
|
|
85
|
+
| - | - | - | - |
|
|
86
|
+
| `--semi-color-success` | var(--semi-green-5) | var(--semi-green-5) | 成功色,表示安全、成功、开启的状态 |
|
|
87
|
+
| `--semi-color-success-hover` | var(--semi-green-6) | var(--semi-green-6) | 成功色悬浮态 |
|
|
88
|
+
| `--semi-color-success-active` | var(--semi-green-7) | var(--semi-green-7) | 成功色激活态 |
|
|
89
|
+
| `--semi-color-success-disabled` | var(--semi-green-2) | var(--semi-green-2) | 成功色禁用态 |
|
|
90
|
+
| `--semi-color-success-light-default` | var(--semi-green-0) | color-mix(in srgb, var(--semi-green-5) 20%, transparent) | 浅版成功色(多用于背景),表示安全、成功、开启的状态 |
|
|
91
|
+
| `--semi-color-success-light-hover` | var(--semi-green-1) | color-mix(in srgb, var(--semi-green-5) 30%, transparent) | 浅版成功色悬浮态 |
|
|
92
|
+
| `--semi-color-success-light-active` | var(--semi-green-2) | color-mix(in srgb, var(--semi-green-5) 40%, transparent) | 浅版成功色激活态 |
|
|
93
|
+
|
|
94
|
+
### Warning - warning
|
|
95
|
+
|
|
96
|
+
It is usually used to express warning and unsafe state, and is used in scenarios with the above semantics
|
|
97
|
+
|
|
98
|
+
| Variable | Light | Dark | Usage |
|
|
99
|
+
| - | - | - | - |
|
|
100
|
+
| `--semi-color-warning` | var(--semi-orange-5) | var(--semi-orange-5) | 警示色,表示警告、不安全的状态 |
|
|
101
|
+
| `--semi-color-warning-hover` | var(--semi-orange-6) | var(--semi-orange-6) | 警示色悬浮态 |
|
|
102
|
+
| `--semi-color-warning-active` | var(--semi-orange-7) | var(--semi-orange-7) | 警示色激活态 |
|
|
103
|
+
| `--semi-color-warning-light-default` | var(--semi-orange-0) | color-mix(in srgb, var(--semi-orange-5) 20%, transparent) | 浅版警示色(多用于背景),表示警告、不安全的状态 |
|
|
104
|
+
| `--semi-color-warning-light-hover` | var(--semi-orange-1) | color-mix(in srgb, var(--semi-orange-5) 30%, transparent) | 浅版警示色悬浮态 |
|
|
105
|
+
| `--semi-color-warning-light-active` | var(--semi-orange-2) | color-mix(in srgb, var(--semi-orange-5) 40%, transparent) | 浅版警示色激活态 |
|
|
106
|
+
|
|
107
|
+
### Danger - danger
|
|
108
|
+
|
|
109
|
+
It is usually used to express the dangerous state, and is used in the scene with the above semantics
|
|
110
|
+
|
|
111
|
+
| Variable | Light | Dark | Usage |
|
|
112
|
+
| - | - | - | - |
|
|
113
|
+
| `--semi-color-danger` | var(--semi-red-5) | var(--semi-red-5) | 危险色,表示危险的操作、或需要特别注意的危险信息 |
|
|
114
|
+
| `--semi-color-danger-hover` | var(--semi-red-6) | var(--semi-red-6) | 危险色悬浮态 |
|
|
115
|
+
| `--semi-color-danger-active` | var(--semi-red-7) | var(--semi-red-7) | 危险色激活态 |
|
|
116
|
+
| `--semi-color-danger-light-default` | var(--semi-red-0) | color-mix(in srgb, var(--semi-red-5) 20%, transparent) | 浅版危险色(多用于背景),表示危险的操作、或需要特别注意的危险信息 |
|
|
117
|
+
| `--semi-color-danger-light-hover` | var(--semi-red-1) | color-mix(in srgb, var(--semi-red-5) 30%, transparent) | 浅版危险色悬浮态 |
|
|
118
|
+
| `--semi-color-danger-light-active` | var(--semi-red-2) | color-mix(in srgb, var(--semi-red-5) 40%, transparent) | 浅版危险色激活态 |
|
|
119
|
+
|
|
120
|
+
### AI - general
|
|
121
|
+
|
|
122
|
+
Background and text colors for AI scenarios
|
|
123
|
+
|
|
124
|
+
| Variable | Light | Dark | Usage |
|
|
125
|
+
| - | - | - | - |
|
|
126
|
+
| `--semi-color-ai-general` | var(--semi-ai-general-5) | var(--semi-ai-general-5) | AI 场景颜色 |
|
|
127
|
+
| `--semi-color-ai-general-hover` | var(--semi-ai-general-6) | var(--semi-ai-general-6) | AI 场景颜色 - 悬浮态 |
|
|
128
|
+
| `--semi-color-ai-general-active` | var(--semi-ai-general-7) | var(--semi-ai-general-7) | AI 场景颜色 - 激活态 |
|
|
129
|
+
| `--semi-color-ai-general-disabled` | var(--semi-ai-general-2) | var(--semi-ai-general-2) | AI 场景颜色 - 禁用态 |
|
|
130
|
+
|
|
131
|
+
### AI - purple
|
|
132
|
+
|
|
133
|
+
Background and text colors for secondary AI scenarios
|
|
134
|
+
|
|
135
|
+
| Variable | Light | Dark | Usage |
|
|
136
|
+
| - | - | - | - |
|
|
137
|
+
| `--semi-color-ai-purple` | var(--semi-ai-purple-5) | var(--semi-ai-purple-5) | AI 次要场景颜色 |
|
|
138
|
+
| `--semi-color-ai-purple-hover` | var(--semi-ai-purple-6) | var(--semi-ai-purple-6) | AI 次要场景颜色 - 悬浮态 |
|
|
139
|
+
| `--semi-color-ai-purple-active` | var(--semi-ai-purple-7) | var(--semi-ai-purple-7) | AI 次要场景颜色 - 激活态 |
|
|
140
|
+
| `--semi-color-ai-purple-disabled` | var(--semi-ai-purple-2) | var(--semi-ai-purple-2) | AI 次要场景颜色 - 禁用态 |
|
|
141
|
+
|
|
142
|
+
### AI - background
|
|
143
|
+
|
|
144
|
+
Background colors for AI scenarios
|
|
145
|
+
|
|
146
|
+
| Variable | Light | Dark | Usage |
|
|
147
|
+
| - | - | - | - |
|
|
148
|
+
| `--semi-color-ai-background-bottom` | linear-gradient(201.15deg, rgba(255, 255, 255, 0.04) 6.58%, rgba(255, 226, 138, 0.04) 32.88%, rgba(231, 45, 255, 0.04) 67.93%, rgba(0, 115, 255, 0.04) 94.23%) | linear-gradient(201.15deg, rgba(255, 226, 138, 0.2) 6.58%, rgba(231, 45, 255, 0.2) 50.4%, rgba(0, 115, 255, 0.2) 94.23%) | AI 场景背景色底部 |
|
|
149
|
+
| `--semi-color-ai-background-bottom-hover` | linear-gradient(201.15deg, rgba(255, 255, 255, 0.08) 6.58%, rgba(255, 226, 138, 0.08) 32.88%, rgba(231, 45, 255, 0.08) 67.93%, rgba(0, 115, 255, 0.08) 94.23%) | linear-gradient(201.15deg, rgba(255, 226, 138, 0.3) 6.58%, rgba(231, 45, 255, 0.3) 50.4%, rgba(0, 115, 255, 0.3) 94.23%) | AI 场景背景色底部 - 悬浮态 |
|
|
150
|
+
| `--semi-color-ai-background-bottom-active` | linear-gradient(201.15deg, rgba(255, 255, 255, 0.12) 6.58%, rgba(255, 226, 138, 0.12) 32.88%, rgba(231, 45, 255, 0.12) 67.93%, rgba(0, 115, 255, 0.12) 94.23%) | linear-gradient(201.15deg, rgba(255, 226, 138, 0.4) 6.58%, rgba(231, 45, 255, 0.4) 50.4%, rgba(0, 115, 255, 0.4) 94.23%) | AI 场景背景色底部 - 激活态 |
|
|
151
|
+
| `--semi-color-ai-background-top` | linear-gradient(201.15deg, rgba(83, 56, 255, 0.16) 6.58%, rgba(176, 48, 240, 0.096) 32.88%, rgba(231, 45, 255, 0.048) 59.17%, rgba(255, 255, 255, 0) 94.23%) | linear-gradient(201.15deg, rgba(83, 56, 255, 0.36) 6.58%, rgba(176, 48, 240, 0.216) 32.88%, rgba(154, 0, 174, 0.108) 59.17%, rgba(0, 0, 0, 0) 94.23%) | AI 场景背景色顶部 |
|
|
152
|
+
| `--semi-color-ai-background-top-hover` | linear-gradient(201.15deg, rgba(83, 56, 255, 0.24) 6.58%, rgba(176, 48, 240, 0.144) 32.88%, rgba(231, 45, 255, 0.072) 59.17%, rgba(255, 255, 255, 0) 94.23%) | linear-gradient(201.15deg, rgba(83, 56, 255, 0.54) 6.58%, rgba(176, 48, 240, 0.324) 32.88%, rgba(154, 0, 174, 0.162) 59.17%, rgba(0, 0, 0, 0) 94.23%) | AI 场景背景色顶部 - 悬浮态 |
|
|
153
|
+
| `--semi-color-ai-background-top-active` | linear-gradient(201.15deg, rgba(83, 56, 255, 0.32) 6.58%, rgba(176, 48, 240, 0.192) 32.88%, rgba(231, 45, 255, 0.096) 59.17%, rgba(255, 255, 255, 0) 94.23%) | linear-gradient(201.15deg, rgba(83, 56, 255, 0.72) 6.58%, rgba(176, 48, 240, 0.432) 32.88%, rgba(154, 0, 174, 0.216) 59.17%, rgba(0, 0, 0, 0) 94.23%) | AI 场景背景色顶部 - 激活态 |
|
|
154
|
+
|
|
155
|
+
### Text and icon colors - text
|
|
156
|
+
|
|
157
|
+
Four different levels of text / icon colors represent the most important, secondary, minor and minor contents in the product interface
|
|
158
|
+
|
|
159
|
+
| Variable | Light | Dark | Usage |
|
|
160
|
+
| - | - | - | - |
|
|
161
|
+
| `--semi-color-text-0` | var(--semi-grey-9) | var(--semi-grey-9) | 文本/图标颜色 - 最主要 |
|
|
162
|
+
| `--semi-color-text-1` | color-mix(in srgb, var(--semi-grey-9) 80%, transparent) | color-mix(in srgb, var(--semi-grey-9) 80%, transparent) | 文本/图标颜色 - 稍次要 |
|
|
163
|
+
| `--semi-color-text-3` | color-mix(in srgb, var(--semi-grey-9) 35%, transparent) | color-mix(in srgb, var(--semi-grey-9) 35%, transparent) | 文本/图标颜色 - 最次要 |
|
|
164
|
+
| `--semi-color-text-2` | color-mix(in srgb, var(--semi-grey-9) 62%, transparent) | color-mix(in srgb, var(--semi-grey-9) 60%, transparent) | 文本/图标颜色 - 次要 |
|
|
165
|
+
|
|
166
|
+
### Link color - link
|
|
167
|
+
|
|
168
|
+
Text used for hyperlinks in products
|
|
169
|
+
|
|
170
|
+
| Variable | Light | Dark | Usage |
|
|
171
|
+
| - | - | - | - |
|
|
172
|
+
| `--semi-color-link` | var(--semi-blue-5) | var(--semi-blue-5) | 链接颜色 |
|
|
173
|
+
| `--semi-color-link-hover` | var(--semi-blue-6) | var(--semi-blue-6) | 链接颜色 - 悬浮态 |
|
|
174
|
+
| `--semi-color-link-active` | var(--semi-blue-7) | var(--semi-blue-7) | 链接颜色 - 激活态 |
|
|
175
|
+
| `--semi-color-link-visited` | var(--semi-blue-5) | var(--semi-blue-5) | 链接颜色 - 已访问 |
|
|
176
|
+
|
|
177
|
+
### Background color - bg
|
|
178
|
+
|
|
179
|
+
All levels of background color in the application, including container, menu, navigation bar, etc. In dark mode, we usually use the background color to distinguish the front and back levels
|
|
180
|
+
|
|
181
|
+
| Variable | Light | Dark | Usage |
|
|
182
|
+
| - | - | - | - |
|
|
183
|
+
| `--semi-color-bg-0` | var(--semi-white) | rgba(22, 22, 26, 1) | 背景色 - 最下层(底部页面) |
|
|
184
|
+
| `--semi-color-bg-1` | var(--semi-white) | rgba(35, 36, 41, 1) | 背景色 - 次下层(页面中需要提升的内容) |
|
|
185
|
+
| `--semi-color-bg-2` | var(--semi-white) | rgba(53, 54, 60, 1) | 背景色 - 中间层(模态等容器) |
|
|
186
|
+
| `--semi-color-bg-3` | var(--semi-white) | rgba(67, 68, 74, 1) | 背景色 - 次上层(通知,Toast等) |
|
|
187
|
+
| `--semi-color-bg-4` | var(--semi-white) | rgba(79, 81, 89, 1) | 背景色 - 最上层(特殊) |
|
|
188
|
+
|
|
189
|
+
### Fill color - fill
|
|
190
|
+
|
|
191
|
+
For an element, if the background color of its container is not fixed, and the contrast between the filling color of the element and the top background color is small, use the filling color as the background color to ensure that the element will not "melt" into a certain level of background color, such as a form control.
|
|
192
|
+
|
|
193
|
+
| Variable | Light | Dark | Usage |
|
|
194
|
+
| - | - | - | - |
|
|
195
|
+
| `--semi-color-fill-0` | color-mix(in srgb, var(--semi-grey-8) 5%, transparent) | color-mix(in srgb, var(--semi-white) 12%, transparent) | 填充色 - 默认态 |
|
|
196
|
+
| `--semi-color-fill-1` | color-mix(in srgb, var(--semi-grey-8) 9%, transparent) | color-mix(in srgb, var(--semi-white) 16%, transparent) | 填充色 - 悬浮态 |
|
|
197
|
+
| `--semi-color-fill-2` | color-mix(in srgb, var(--semi-grey-8) 13%, transparent) | color-mix(in srgb, var(--semi-white) 20%, transparent) | 填充色 - 激活态 |
|
|
198
|
+
|
|
199
|
+
### Border color - border
|
|
200
|
+
|
|
201
|
+
Colors with stroke attributes in the interface
|
|
202
|
+
|
|
203
|
+
| Variable | Light | Dark | Usage |
|
|
204
|
+
| - | - | - | - |
|
|
205
|
+
| `--semi-color-border` | color-mix(in srgb, var(--semi-grey-9) 8%, transparent) | color-mix(in srgb, var(--semi-white) 8%, transparent) | 默认描边颜色 |
|
|
206
|
+
|
|
207
|
+
### Disabled state - disabled
|
|
208
|
+
|
|
209
|
+
It is used to fill all kinds of forbidden elements in the interface, such as background, text, stroke, fill, etc
|
|
210
|
+
|
|
211
|
+
| Variable | Light | Dark | Usage |
|
|
212
|
+
| - | - | - | - |
|
|
213
|
+
| `--semi-color-disabled-text` | color-mix(in srgb, var(--semi-grey-9) 35%, transparent) | color-mix(in srgb, var(--semi-grey-9) 35%, transparent) | 禁用态 - 文字 |
|
|
214
|
+
| `--semi-color-disabled-border` | var(--semi-grey-1) | var(--semi-grey-1) | 禁用态 - 描边 |
|
|
215
|
+
| `--semi-color-disabled-bg` | var(--semi-grey-1) | var(--semi-grey-1) | 禁用态 - 背景 |
|
|
216
|
+
| `--semi-color-disabled-fill` | color-mix(in srgb, var(--semi-grey-8) 4%, transparent) | color-mix(in srgb, var(--semi-grey-8) 4%, transparent) | 禁用态 - 填充 |
|
|
217
|
+
|
|
218
|
+
### Constant color - static
|
|
219
|
+
|
|
220
|
+
The interface does not follow the theme and light and dark mode switching color
|
|
221
|
+
|
|
222
|
+
| Variable | Light | Dark | Usage |
|
|
223
|
+
| - | - | - | - |
|
|
224
|
+
|
|
225
|
+
### Simulated shadow color - shadow
|
|
226
|
+
|
|
227
|
+
Shallow shadow, a flat shadow effect simulated by border, is mainly used in the table component
|
|
228
|
+
|
|
229
|
+
| Variable | Light | Dark | Usage |
|
|
230
|
+
| - | - | - | - |
|
|
231
|
+
| `--semi-color-shadow` | color-mix(in srgb, var(--semi-black) 4%, transparent) | color-mix(in srgb, var(--semi-black) 4%, transparent) | 用于模拟描边的阴影颜色 |
|
|
232
|
+
|
|
233
|
+
## Typesetting
|
|
234
|
+
|
|
235
|
+
Typesetting is used to convey information content, and the interface looks orderly
|
|
236
|
+
|
|
237
|
+
### Trade name
|
|
238
|
+
|
|
239
|
+
Determines the size of different levels of text
|
|
240
|
+
|
|
241
|
+
| Variable | Light | Dark | Usage |
|
|
242
|
+
| - | - | - | - |
|
|
243
|
+
| `--semi-font-size-small` | 12px | 12px | 小文本字号 |
|
|
244
|
+
| `--semi-font-size-regular` | 14px | 14px | 常规文本字号 |
|
|
245
|
+
| `--semi-font-size-header-6` | 16px | 16px | 六级标题字号 |
|
|
246
|
+
| `--semi-font-size-header-5` | 18px | 18px | 五级标题字号 |
|
|
247
|
+
| `--semi-font-size-header-4` | 20px | 20px | 四级标题字号 |
|
|
248
|
+
| `--semi-font-size-header-3` | 24px | 24px | 三级标题字号 |
|
|
249
|
+
| `--semi-font-size-header-2` | 28px | 28px | 二级标题字号 |
|
|
250
|
+
| `--semi-font-size-header-1` | 32px | 32px | 一级标题字号 |
|
|
251
|
+
|
|
252
|
+
### Word weight
|
|
253
|
+
|
|
254
|
+
Determine the thickness of different levels of text
|
|
255
|
+
|
|
256
|
+
| Variable | Light | Dark | Usage |
|
|
257
|
+
| - | - | - | - |
|
|
258
|
+
| `--semi-font-weight-light` | 200 | 200 | 字重 - 轻 |
|
|
259
|
+
| `--semi-font-weight-regular` | 400 | 400 | 字重 - 常规 |
|
|
260
|
+
| `--semi-font-weight-bold` | 600 | 600 | 字重 - 加粗 |
|
|
261
|
+
|
|
262
|
+
### Font
|
|
263
|
+
|
|
264
|
+
In order to reduce the packing volume, the default English font inter needs to be introduced separately
|
|
265
|
+
|
|
266
|
+
If you want to use it on the business side, you need to add a font face statement in your CSS (it is not included in Semi, because the font is slightly larger, and the default loading may affect the speed of the first screen of the business). It is up to the business to decide whether to use it or not.
|
|
267
|
+
|
|
268
|
+
```css
|
|
269
|
+
@font-face {
|
|
270
|
+
font-family: 'Inter';
|
|
271
|
+
src: url('/assets/fonts/inter-regular.ttf') format('truetype');
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
@font-face {
|
|
275
|
+
font-family: 'Inter-Bold';
|
|
276
|
+
src: url('/assets/fonts/inter-bold.ttf') format('truetype');
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
| Variable | Light | Dark | Usage |
|
|
281
|
+
| - | - | - | - |
|
|
282
|
+
| `--semi-font-family-regular` | 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif | 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif | semi 预置字体回退 |
|
|
283
|
+
|
|
284
|
+
## Fillet
|
|
285
|
+
|
|
286
|
+
Fillet is used to describe the outline of container and interface elements, which determines the visual tonality of product to a certain extent
|
|
287
|
+
|
|
288
|
+
| Variable | Light | Dark | Usage |
|
|
289
|
+
| - | - | - | - |
|
|
290
|
+
| `--semi-border-radius-extra-small` | 3px | 3px | 超小圆角,用于 checkbox 内圆角 |
|
|
291
|
+
| `--semi-border-radius-small` | 3px | 3px | 小圆角, 用于 button、tag、tabs 等大多数组件, 比较常用 |
|
|
292
|
+
| `--semi-border-radius-medium` | 6px | 6px | 中圆角, 用于 dropdown、scrollist、transfer 等菜单类组件 |
|
|
293
|
+
| `--semi-border-radius-large` | 12px | 12px | 大圆角, 用于 modal |
|
|
294
|
+
| `--semi-border-radius-circle` | 50% | 50% | 全圆角, 用于 avatar, badge 等组件 |
|
|
295
|
+
| `--semi-border-radius-full` | 9999px | 9999px | 用于创建全尺寸圆角,如胶囊标签等 |
|
|
296
|
+
|
|
297
|
+
## Shadow
|
|
298
|
+
|
|
299
|
+
Shadow is usually used to express the level of interface elements. The heavier the shadow, the closer the element is to the user
|
|
300
|
+
|
|
301
|
+
| Variable | Light | Dark | Usage |
|
|
302
|
+
| - | - | - | - |
|
|
303
|
+
| `--semi-shadow-knob` | 0 4px 6px rgba(0, 0, 0, 0.1), 0 0 1px rgba(0, 0, 0, 0.3) | 0 4px 6px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.3) | 用于 switch、slider 等滑块的阴影 |
|
|
304
|
+
| `--semi-shadow-elevated` | 0 0 1px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.1) | inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 4px 14px rgba(0, 0, 0, 0.25) | 用于toast, modal, popover等需要提升层级的界面元素 |
|
|
305
|
+
|
|
306
|
+
## Dimensions
|
|
307
|
+
|
|
308
|
+
The size variable is used in various components and internal elements to adjust the size of the control, stroke thickness, etc
|
|
309
|
+
|
|
310
|
+
### Height
|
|
311
|
+
|
|
312
|
+
| Variable | Light | Dark | Usage |
|
|
313
|
+
| - | - | - | - |
|
|
314
|
+
| `--semi-height-control-small` | #{$height-control-small} | #{$height-control-small} | 表单项高度 - 小尺寸 |
|
|
315
|
+
| `--semi-height-control-default` | #{$height-control-default} | #{$height-control-default} | 表单项高度 - 默认尺寸 |
|
|
316
|
+
| `--semi-height-control-large` | #{$height-control-large} | #{$height-control-large} | 表单项高度 - 大尺寸 |
|
|
317
|
+
|
|
318
|
+
### Stroke size
|
|
319
|
+
|
|
320
|
+
| Variable | Light | Dark | Usage |
|
|
321
|
+
| - | - | - | - |
|
|
322
|
+
| `--semi-border-thickness` | #{$border-thickness} | #{$border-thickness} | 描边宽度 - 零 |
|
|
323
|
+
| `--semi-border-thickness-control` | #{$border-thickness-control} | #{$border-thickness-control} | 描边宽度 - 默认状态 |
|
|
324
|
+
| `--semi-border-thickness-control-focus` | 1px | 1px | 描边宽度 - focus 状态 |
|
|
325
|
+
|
|
326
|
+
## Spacing
|
|
327
|
+
|
|
328
|
+
The spacing variable is applied in each component or between components to adjust the density and compactness of the whole product
|
|
329
|
+
|
|
330
|
+
| Variable | Light | Dark | Usage |
|
|
331
|
+
| - | - | - | - |
|
|
332
|
+
| `--semi-spacing-none` | 0 | 0 | 间距 - 零 |
|
|
333
|
+
| `--semi-spacing-super-tight` | #{$spacing-super-tight} | #{$spacing-super-tight} | 间距 - 极紧凑 |
|
|
334
|
+
| `--semi-spacing-extra-tight` | #{$spacing-extra-tight} | #{$spacing-extra-tight} | 间距 - 超紧凑 |
|
|
335
|
+
| `--semi-spacing-tight` | #{$spacing-tight} | #{$spacing-tight} | 间距 - 紧凑 |
|
|
336
|
+
| `--semi-spacing-base-tight` | #{$spacing-base-tight} | #{$spacing-base-tight} | 间距 - 默认(偏紧凑) |
|
|
337
|
+
| `--semi-spacing-base` | #{$spacing-base} | #{$spacing-base} | 间距 - 默认 |
|
|
338
|
+
| `--semi-spacing-base-loose` | #{$spacing-base-loose} | #{$spacing-base-loose} | 间距 - 默认(偏宽松) |
|
|
339
|
+
| `--semi-spacing-loose` | 24px | 24px | 间距 - 宽松 |
|
|
340
|
+
| `--semi-spacing-extra-loose` | 32px | 32px | 间距 - 超宽松 |
|
|
341
|
+
| `--semi-spacing-super-loose` | #{$spacing-super-loose} | #{$spacing-super-loose} | 间距 - 极宽松 |
|
|
342
|
+
|
|
343
|
+
## z-index
|
|
344
|
+
|
|
345
|
+
It is used to describe the sequence of interface elements
|
|
346
|
+
|
|
347
|
+
| Variable | Light | Dark | Usage |
|
|
348
|
+
| - | - | - | - |
|
|
349
|
+
| `--semi-z-portal` | 1 | 1 | 抽象插槽,适用于未经特殊定制的所有组件 |
|
|
350
|
+
| `--semi-z-affix` | 10 | 10 | 固定位置的页面元素 |
|
|
351
|
+
| `--semi-z-backtop` | 10 | 10 | 返回顶部 |
|
|
352
|
+
| `--semi-z-badge` | 1 | 1 | badge |
|
|
353
|
+
| `--semi-z-table-fixed` | #{$z-table-fixed} | #{$z-table-fixed} | table fixed column |
|
|
354
|
+
| `--semi-z-modal` | 1000 | 1000 | modal |
|
|
355
|
+
| `--semi-z-modal-mask` | 1000 | 1000 | modal 遮罩 |
|
|
356
|
+
| `--semi-z-toast` | 1010 | 1010 | toast |
|
|
357
|
+
| `--semi-z-notification` | 1010 | 1010 | notification |
|
|
358
|
+
| `--semi-z-image_preview` | 1070 | 1070 | Image 预览层 |
|
|
359
|
+
| `--semi-z-image_preview_header` | 1 | 1 | Image 预览层 header |
|
|
360
|
+
| `--semi-z-resizable_handler` | 10 | 10 | 伸缩框 handler,低于弹出层 |
|
|
361
|
+
|
|
362
|
+
## Animation
|
|
363
|
+
|
|
364
|
+
| Variable | Value | Usage |
|
|
365
|
+
| - | - | - |
|
|
366
|
+
| `--semi-transition_duration-slowest` | 0ms | |
|
|
367
|
+
| `--semi-transition_duration-slower` | 0ms | |
|
|
368
|
+
| `--semi-transition_duration-slow` | 0ms | |
|
|
369
|
+
| `--semi-transition_duration-normal` | 0ms | |
|
|
370
|
+
| `--semi-transition_duration-fast` | 0ms | |
|
|
371
|
+
| `--semi-transition_duration-faster` | 0ms | |
|
|
372
|
+
| `--semi-transition_duration-fastest` | 0ms | |
|
|
373
|
+
| `--semi-transition_duration-none` | 0ms | |
|
|
374
|
+
| `--semi-transition_function-linear` | linear | |
|
|
375
|
+
| `--semi-transition_function-ease` | ease | |
|
|
376
|
+
| `--semi-transition_function-easeIn` | ease-in | |
|
|
377
|
+
| `--semi-transition_function-easeOut` | ease-out | |
|
|
378
|
+
| `--semi-transition_function-easeInIOut` | ease-in-out | |
|
|
379
|
+
| `--semi-transition_delay-none` | 0ms | |
|
|
380
|
+
| `--semi-transition_delay-slowest` | 0ms | |
|
|
381
|
+
| `--semi-transition_delay-slower` | 0ms | |
|
|
382
|
+
| `--semi-transition_delay-slow` | 0ms | |
|
|
383
|
+
| `--semi-transition_delay-normal` | 0ms | |
|
|
384
|
+
| `--semi-transition_delay-fast` | 0ms | |
|
|
385
|
+
| `--semi-transition_delay-faster` | 0ms | |
|
|
386
|
+
| `--semi-transition_delay-fastest` | 0ms | |
|
|
387
|
+
| `--semi-transform_scale-none` | scale(1, 1) | |
|
|
388
|
+
| `--semi-transform_scale-small` | scale(1, 1) | |
|
|
389
|
+
| `--semi-transform_scale-medium` | scale(1, 1) | |
|
|
390
|
+
| `--semi-transform_scale-large` | scale(1, 1) | |
|
|
391
|
+
| `--semi-transform_rotate-none` | rotate(0deg) | |
|
|
392
|
+
| `--semi-transform_rotate-clockwise90deg` | rotate(90deg) | |
|
|
393
|
+
| `--semi-transform_rotate-clockwise180deg` | rotate(180deg) | |
|
|
394
|
+
| `--semi-transform_rotate-clockwise270deg` | rotate(270deg) | |
|
|
395
|
+
| `--semi-transform_rotate-clockwise360deg` | rotate(360deg) | |
|
|
396
|
+
| `--semi-transform_rotate-anticlockwise90deg` | rotate(-90deg) | |
|
|
397
|
+
| `--semi-transform_rotate-anticlockwise180deg` | rotate(-180deg) | |
|
|
398
|
+
| `--semi-transform_rotate-anticlockwise270deg` | rotate(-270deg) | |
|
|
399
|
+
| `--semi-transform_rotate-anticlockwise360deg` | rotate(-360deg) | |
|
|
400
|
+
|
|
401
|
+
## Variables not yet supported
|
|
402
|
+
|
|
403
|
+
Currently, Semi does not support global variables in the following categories. If you have related requirements, you can give feedback through issue and describe your expected needs in detail.
|
|
404
|
+
|
|
405
|
+
**Line height**
|
|
406
|
+
|
|
407
|
+
**Letter spacing**
|
|
408
|
+
|
|
409
|
+
**Media query**
|
|
410
|
+
|
|
411
|
+
## Customization
|
|
412
|
+
|
|
413
|
+
The `--semi-*` CSS variables on this page are Semi's global customization surface. Override them in your own stylesheet; no build plugin or theme package is needed:
|
|
414
|
+
|
|
415
|
+
```css
|
|
416
|
+
:root {
|
|
417
|
+
--semi-color-primary: var(--semi-violet-5);
|
|
418
|
+
--semi-border-radius-medium: 8px;
|
|
419
|
+
}
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
- Light values go on `:root`, dark values on `[theme-mode='dark']`; see [Dark Mode](../advanced/dark-mode.md).
|
|
423
|
+
- Semi's styles sit in `@layer semi`, so your unlayered CSS rules always win and can override a component's own styles without `!important`.
|
|
424
|
+
- With Tailwind, import `@fibrae/semi-ui-react/tailwind.css` (`@fibrae/semi-ui-vue/tailwind.css` for Vue, `@fibrae/semi-ui-solid/tailwind.css` for Solid, `@fibrae/semi-ui-svelte/tailwind.css` for Svelte) to map these variables to Tailwind theme values (e.g. `bg-semi-color-primary`).
|
|
425
|
+
- The Design Token tables on the component pages list each component's internal Sass variables, which cannot be overridden.
|