@xihan-ui/styles 1.0.0 → 2.0.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/CHANGELOG.md +5146 -6
- package/README.md +22 -2
- package/component-tokens.d.ts +4212 -0
- package/component-tokens.js +2 -0
- package/components.tokens.json +80116 -0
- package/css/accordion.css +131 -75
- package/css/affix.css +16 -1
- package/css/alert.css +114 -67
- package/css/anchor.css +99 -27
- package/css/approval.css +461 -0
- package/css/avatar-group.css +14 -6
- package/css/avatar.css +33 -9
- package/css/back-top.css +103 -48
- package/css/badge.css +42 -14
- package/css/bar-code.css +62 -0
- package/css/breadcrumb.css +40 -21
- package/css/button-group.css +146 -24
- package/css/button.css +116 -99
- package/css/calendar-picker.css +448 -0
- package/css/calendar-range-picker.css +517 -0
- package/css/card.css +54 -77
- package/css/carousel.css +412 -68
- package/css/cascader.css +429 -246
- package/css/checkbox-group.css +225 -77
- package/css/checkbox.css +174 -37
- package/css/clipboard.css +266 -47
- package/css/code-view.css +279 -0
- package/css/collapsible.css +108 -63
- package/css/color-field.css +158 -0
- package/css/color-picker.css +172 -184
- package/css/color-slider.css +274 -0
- package/css/color-swatch-picker.css +243 -0
- package/css/color-swatch.css +35 -0
- package/css/combobox.css +267 -273
- package/css/command.css +399 -0
- package/css/context-menu.css +183 -108
- package/css/date-field.css +94 -121
- package/css/date-picker.css +486 -249
- package/css/date-range-picker.css +559 -0
- package/css/description.css +51 -0
- package/css/descriptions.css +133 -87
- package/css/dialog.css +247 -68
- package/css/diff-view.css +428 -0
- package/css/download-trigger.css +155 -46
- package/css/drawer.css +194 -111
- package/css/editable.css +172 -152
- package/css/empty-state.css +80 -11
- package/css/field-array.css +190 -0
- package/css/field.css +84 -31
- package/css/fieldset.css +51 -18
- package/css/file-upload.css +134 -36
- package/css/flex.css +20 -1
- package/css/float-button.css +238 -57
- package/css/floating-panel.css +173 -92
- package/css/focus.css +46 -0
- package/css/forced-colors.css +93 -0
- package/css/form.css +254 -77
- package/css/gradient-text.css +34 -10
- package/css/grid.css +516 -5
- package/css/heatmap.css +87 -29
- package/css/highlight.css +20 -5
- package/css/hover-card.css +97 -47
- package/css/icon-wrapper.css +15 -3
- package/css/icon.css +74 -8
- package/css/image-cropper.css +143 -29
- package/css/image-viewer.css +150 -89
- package/css/image.css +30 -1
- package/css/infinite-scroll.css +51 -1
- package/css/input-group.css +277 -0
- package/css/json-viewer.css +102 -45
- package/css/kbd.css +72 -0
- package/css/label.css +78 -0
- package/css/layers.css +5 -0
- package/css/layout.css +175 -31
- package/css/list.css +24 -3
- package/css/listbox.css +208 -67
- package/css/loading-bar.css +52 -3
- package/css/log.css +144 -9
- package/css/markdown-stream.css +149 -0
- package/css/marquee.css +27 -1
- package/css/masonry.css +7 -0
- package/css/matrix-code.css +67 -0
- package/css/mention.css +234 -152
- package/css/menu.css +180 -83
- package/css/menubar.css +204 -136
- package/css/message-feed.css +197 -0
- package/css/navigation-menu.css +144 -90
- package/css/notification.css +178 -100
- package/css/number-animation.css +7 -0
- package/css/number-field.css +120 -277
- package/css/overlay-arrow.css +12 -7
- package/css/page-header.css +99 -14
- package/css/pagination.css +175 -135
- package/css/password-input.css +222 -219
- package/css/pin-input.css +101 -67
- package/css/pointer.css +36 -0
- package/css/popconfirm.css +185 -94
- package/css/popover.css +121 -77
- package/css/progress.css +60 -12
- package/css/prompt-input.css +224 -0
- package/css/question-flow.css +513 -0
- package/css/radio-group.css +147 -30
- package/css/rating.css +193 -43
- package/css/reasoning.css +336 -0
- package/css/reset.css +84 -6
- package/css/resizable.css +237 -0
- package/css/scroll-area.css +68 -7
- package/css/scrollbar.css +47 -13
- package/css/segmented.css +94 -29
- package/css/select.css +288 -274
- package/css/separator.css +101 -1
- package/css/side-nav.css +133 -75
- package/css/signature-pad.css +74 -54
- package/css/skeleton.css +84 -11
- package/css/slider.css +132 -39
- package/css/sortable.css +198 -0
- package/css/spinner.css +126 -12
- package/css/splitter.css +29 -8
- package/css/statistic.css +55 -0
- package/css/steps.css +206 -72
- package/css/switch.css +268 -36
- package/css/table.css +695 -118
- package/css/tabs.css +604 -42
- package/css/tag-group.css +219 -0
- package/css/tag.css +118 -28
- package/css/tags-input.css +156 -274
- package/css/text-field.css +101 -249
- package/css/time-field.css +100 -128
- package/css/time-picker.css +323 -252
- package/css/time-range-picker.css +719 -0
- package/css/timeline.css +202 -68
- package/css/timer.css +56 -52
- package/css/timestamp.css +34 -0
- package/css/toast.css +373 -144
- package/css/toggle-group.css +309 -76
- package/css/toggle.css +116 -85
- package/css/tone.css +47 -0
- package/css/tool-call.css +421 -0
- package/css/toolbar.css +181 -33
- package/css/tooltip.css +107 -36
- package/css/tour.css +183 -152
- package/css/transfer.css +351 -138
- package/css/tree-select.css +323 -216
- package/css/tree.css +294 -62
- package/css/truncate.css +65 -0
- package/css/typography.css +228 -5
- package/css/undefined.css +10 -1
- package/css/virtualizer.css +9 -10
- package/css/visually-hidden.css +7 -0
- package/css/watermark.css +7 -0
- package/family/action-control.css +487 -0
- package/family/collection-item.css +721 -0
- package/family/field-chrome.css +298 -0
- package/family/motion.css +166 -0
- package/family/swatch.css +59 -0
- package/index.css +41705 -126
- package/index.unlayered.css +33692 -17339
- package/package.json +51 -17
- package/css/calendar.css +0 -367
- package/css/code-block.css +0 -91
- package/css/composer.css +0 -134
- package/css/countdown.css +0 -26
- package/css/dynamic-input.css +0 -220
- package/css/ellipsis.css +0 -52
- package/css/hotkeys.css +0 -90
- package/css/popselect.css +0 -391
- package/css/qr-code.css +0 -55
- package/css/result.css +0 -119
- package/css/space.css +0 -117
- package/css/thread.css +0 -120
- package/css/time.css +0 -25
package/css/collapsible.css
CHANGED
|
@@ -1,114 +1,159 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-Present XiHanFun and contributors.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* 定义 collapsible 样式。 */
|
|
7
|
+
|
|
8
|
+
/* 共享关键帧由 family/motion.css 提供,本皮肤 @import 它,单独引入仍成立;
|
|
9
|
+
独立皮肤同时传递引入触发器的动作控件配方,full bundle 递归去重。 */
|
|
10
|
+
@import '../family/motion.css';
|
|
11
|
+
@import '../family/action-control.css';
|
|
12
|
+
|
|
1
13
|
@layer xihan.components {
|
|
2
14
|
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
3
15
|
[data-scope='collapsible'] {
|
|
4
16
|
--xh-collapsible-skin: 1;
|
|
5
17
|
}
|
|
6
18
|
|
|
7
|
-
/*
|
|
8
|
-
|
|
19
|
+
/* 根容器自己不排版,这条只声明尺寸档的私有槽:正文与标题行从 root 继承它们,
|
|
20
|
+
换档不必给部件各写一条选择器;触发器的三档几何由家族 disclosure-trigger 档给 */
|
|
9
21
|
[data-scope='collapsible'][data-part='root'] {
|
|
10
|
-
|
|
11
|
-
--xh-
|
|
22
|
+
/* 作者塞进正文里的图标与皮肤画的兜底字形同一把尺:md 档(§6.5),触发器上另按家族档取值 */
|
|
23
|
+
--xh-icon-size: var(--xh-collapsible-icon-size, var(--xh-glyph-size-md));
|
|
24
|
+
|
|
12
25
|
--xh-_collapsible-trigger-gap: var(--xh-control-gap-md);
|
|
13
|
-
--xh-_collapsible-
|
|
26
|
+
--xh-_collapsible-content-px: var(--xh-space-4);
|
|
27
|
+
--xh-_collapsible-content-pb: var(--xh-space-4);
|
|
28
|
+
|
|
29
|
+
/* 语气落在展开着的触发器上,指示器写在触发器里、跟着继承这个色,不另立规则。
|
|
30
|
+
没写 data-tone 时 --xh-_tone-fg 没被声明,退回原来的前景色。
|
|
31
|
+
聚焦环不在其列,它恒是 --xh-ring-focus */
|
|
32
|
+
--xh-_collapsible-open-fg: var(--xh-_tone-fg, var(--xh-fg-default));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* 触发器与其同排内容住的那一行;触发器自己已经是整行宽,这里只负责把两者摆平 */
|
|
36
|
+
[data-scope='collapsible'][data-part='header'] {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: var(--xh-collapsible-header-gap, var(--xh-_collapsible-trigger-gap));
|
|
40
|
+
inline-size: 100%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[data-scope='collapsible'][data-part='header'][hidden] {
|
|
44
|
+
display: none;
|
|
14
45
|
}
|
|
15
46
|
|
|
16
47
|
/* —— 尺寸 —— */
|
|
17
48
|
/* 缺省档写在上面那条里 */
|
|
18
49
|
[data-scope='collapsible'][data-part='root'][data-size='sm'] {
|
|
19
|
-
--xh-_collapsible-trigger-h: var(--xh-control-h-sm);
|
|
20
|
-
--xh-_collapsible-trigger-px: var(--xh-control-px-sm);
|
|
21
50
|
--xh-_collapsible-trigger-gap: var(--xh-control-gap-sm);
|
|
22
|
-
--xh-_collapsible-
|
|
51
|
+
--xh-_collapsible-content-px: var(--xh-space-3);
|
|
52
|
+
--xh-_collapsible-content-pb: var(--xh-space-3);
|
|
23
53
|
}
|
|
24
54
|
|
|
25
55
|
[data-scope='collapsible'][data-part='root'][data-size='lg'] {
|
|
26
|
-
--xh-_collapsible-trigger-h: var(--xh-control-h-lg);
|
|
27
|
-
--xh-_collapsible-trigger-px: var(--xh-control-px-lg);
|
|
28
56
|
--xh-_collapsible-trigger-gap: var(--xh-control-gap-lg);
|
|
29
|
-
--xh-_collapsible-
|
|
57
|
+
--xh-_collapsible-content-px: var(--xh-space-5);
|
|
58
|
+
--xh-_collapsible-content-pb: var(--xh-space-5);
|
|
30
59
|
}
|
|
31
60
|
|
|
61
|
+
/* 触发器铺满一行,盒型、三档几何、悬停 / 按下 / 禁用面由 Action Control 的 disclosure-trigger 档给
|
|
62
|
+
(ghost 形态:根无壳,按画布承载 hover 100 → pressed 200;按下只换面不缩放,§9.2);
|
|
63
|
+
这里只把使用者槽映射到桥接槽:字色三态同值(家族的 hover / pressed 字色规则比皮肤更特定,不映射会被换回
|
|
64
|
+
缺省字色),字形按触发器自己的档位取 --xh-_action-profile-glyph-size;边归零贴住标题行,几何与迁移前一致 */
|
|
32
65
|
[data-scope='collapsible'][data-part='trigger'] {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
inline
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
66
|
+
--xh-action-gap: var(--xh-collapsible-trigger-gap, var(--xh-_action-profile-gap));
|
|
67
|
+
--xh-action-visual-size: var(--xh-collapsible-trigger-h, var(--xh-_action-profile-visual-size));
|
|
68
|
+
--xh-action-padding-block: var(--xh-collapsible-trigger-py, var(--xh-_action-profile-padding-block));
|
|
69
|
+
--xh-action-padding-inline: var(--xh-collapsible-trigger-px, var(--xh-_action-profile-padding-inline));
|
|
70
|
+
--xh-action-radius: var(--xh-collapsible-trigger-radius, var(--xh-_action-profile-radius));
|
|
71
|
+
--xh-action-bg-rest: var(--xh-collapsible-trigger-bg, var(--xh-_action-variant-bg-rest));
|
|
72
|
+
--xh-action-bg-hover: var(--xh-collapsible-trigger-bg-hover, var(--xh-_action-variant-bg-hover));
|
|
73
|
+
--xh-action-fg-rest: var(--xh-collapsible-trigger-fg, var(--xh-_action-variant-fg-rest));
|
|
74
|
+
--xh-action-fg-hover: var(--xh-collapsible-trigger-fg, var(--xh-_action-variant-fg-hover));
|
|
75
|
+
--xh-action-fg-pressed: var(--xh-collapsible-trigger-fg, var(--xh-_action-variant-fg-pressed));
|
|
76
|
+
--xh-action-font-size: var(--xh-collapsible-trigger-font-size, var(--xh-_action-profile-font-size));
|
|
77
|
+
--xh-icon-size: var(--xh-collapsible-icon-size, var(--xh-_action-profile-glyph-size));
|
|
78
|
+
|
|
79
|
+
border-width: 0;
|
|
45
80
|
font-weight: var(--xh-collapsible-trigger-font-weight, var(--xh-text-label-weight));
|
|
46
|
-
line-height: var(--xh-leading-none);
|
|
47
|
-
cursor: pointer;
|
|
48
81
|
}
|
|
49
82
|
|
|
50
|
-
|
|
51
|
-
|
|
83
|
+
/* 展开着的那一档单开一个槽:与常态共用一个的话,作者一改常态字色就把展开态也改掉了。
|
|
84
|
+
悬停 / 按下的面与收起态同档(§7.3 open 与家族 hover 同档中性) */
|
|
85
|
+
[data-scope='collapsible'][data-part='trigger'][data-state='open'] {
|
|
86
|
+
--xh-action-fg-rest: var(--xh-collapsible-trigger-fg-open, var(--xh-_collapsible-open-fg));
|
|
87
|
+
--xh-action-fg-hover: var(--xh-collapsible-trigger-fg-open, var(--xh-_collapsible-open-fg));
|
|
88
|
+
--xh-action-fg-pressed: var(--xh-collapsible-trigger-fg-open, var(--xh-_collapsible-open-fg));
|
|
52
89
|
}
|
|
53
90
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
91
|
+
/* 禁用前景换成禁用色,不靠 opacity 压暗(家族按 data-disabled 给禁用面与指针,字色槽在这里保留优先) */
|
|
92
|
+
[data-scope='collapsible'][data-part='trigger'][data-disabled] {
|
|
93
|
+
--xh-action-fg-disabled: var(--xh-collapsible-trigger-fg-disabled, var(--xh-_action-variant-fg-disabled));
|
|
57
94
|
}
|
|
58
95
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
96
|
+
/* 开合方向的标记,排在触发器行尾(触发器是 space-between 两端对齐) */
|
|
97
|
+
[data-scope='collapsible'][data-part='indicator'] {
|
|
98
|
+
display: inline-flex;
|
|
99
|
+
flex: none;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
color: var(--xh-collapsible-indicator-fg, var(--xh-fg-muted));
|
|
103
|
+
line-height: var(--xh-leading-none);
|
|
104
|
+
/* 指示器与正文同档转向(§9.4):正文 enter 档展开,箭头也用同一段时长翻过去 */
|
|
105
|
+
transition: rotate var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* 没写内容就由皮肤画;作者往部件里塞了自己的图形,这条规则即不命中 */
|
|
109
|
+
[data-scope='collapsible'][data-part='indicator']:empty::before {
|
|
110
|
+
content: '';
|
|
111
|
+
display: inline-block;
|
|
112
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
113
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-md));
|
|
114
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
115
|
+
background-color: currentColor;
|
|
116
|
+
-webkit-mask: var(--xh-glyph-mark-chevron-down) center / contain no-repeat;
|
|
117
|
+
mask: var(--xh-glyph-mark-chevron-down) center / contain no-repeat;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
[data-scope='collapsible'][data-part='indicator'][data-state='open'] {
|
|
121
|
+
rotate: 180deg;
|
|
62
122
|
}
|
|
63
123
|
|
|
64
124
|
/* 这里刻意没有 [data-part='content'][hidden] { display: none }:补了动画一帧都播不出来。
|
|
65
125
|
收起由适配器在退场结束后写内联 display 落成,退场窗口内靠 connect 发的 inert 挡住焦点 */
|
|
66
126
|
[data-scope='collapsible'][data-part='content'] {
|
|
127
|
+
/* 行高与内缩同帧动的共享关键帧读这条槽:只有末端有内缩,起端不写、按 0 动 */
|
|
128
|
+
--xh-_disclosure-pb: var(--xh-collapsible-content-pb, var(--xh-_collapsible-content-pb));
|
|
129
|
+
|
|
67
130
|
display: grid;
|
|
68
131
|
grid-template-rows: 1fr;
|
|
69
132
|
overflow: clip;
|
|
70
|
-
padding-block:
|
|
71
|
-
|
|
133
|
+
padding-block-start: 0;
|
|
134
|
+
padding-block-end: var(--xh-collapsible-content-pb, var(--xh-_collapsible-content-pb));
|
|
135
|
+
padding-inline: var(--xh-collapsible-content-px, var(--xh-_collapsible-content-px));
|
|
136
|
+
color: var(--xh-collapsible-content-fg, var(--xh-fg-muted));
|
|
137
|
+
font-size: var(--xh-collapsible-content-font-size, var(--xh-text-secondary-size));
|
|
138
|
+
line-height: var(--xh-leading-normal);
|
|
72
139
|
}
|
|
73
140
|
|
|
141
|
+
/* 展开那一档才提前备好行高这条通道:属性随 data-state 一起消失,收起后不长期占着 */
|
|
74
142
|
[data-scope='collapsible'][data-part='content'][data-state='open'] {
|
|
75
|
-
|
|
143
|
+
will-change: grid-template-rows;
|
|
144
|
+
animation: xh-disclosure-expand var(--xh-motion-duration-enter) var(--xh-motion-ease-enter-strong);
|
|
76
145
|
}
|
|
77
146
|
|
|
78
147
|
[data-scope='collapsible'][data-part='content'][data-state='closed'] {
|
|
79
|
-
animation: xh-
|
|
148
|
+
animation: xh-disclosure-collapse var(--xh-motion-duration-exit) var(--xh-motion-ease-exit) forwards;
|
|
80
149
|
}
|
|
81
150
|
}
|
|
82
151
|
|
|
83
152
|
@layer xihan.motion {
|
|
84
|
-
/* 行高与内缩同帧动:内缩不归零的话,border-box 会把盒子钳在上下内缩之和上,收不干净 */
|
|
85
|
-
@keyframes xh-collapsible-expand {
|
|
86
|
-
from {
|
|
87
|
-
grid-template-rows: 0fr;
|
|
88
|
-
padding-block: 0;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
to {
|
|
92
|
-
grid-template-rows: 1fr;
|
|
93
|
-
padding-block: var(--xh-collapsible-content-py, var(--xh-stack-gap-md));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
@keyframes xh-collapsible-collapse {
|
|
98
|
-
from {
|
|
99
|
-
grid-template-rows: 1fr;
|
|
100
|
-
padding-block: var(--xh-collapsible-content-py, var(--xh-stack-gap-md));
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
to {
|
|
104
|
-
grid-template-rows: 0fr;
|
|
105
|
-
padding-block: 0;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
153
|
/* 声明过任何 display 就盖掉了 UA 的 [hidden]{display:none},收起态得自己还回去。
|
|
110
154
|
写在文件末尾:兜底必须排在该部件所有 display 声明之后 */
|
|
111
|
-
[data-scope='collapsible'][data-part='trigger'][hidden]
|
|
155
|
+
[data-scope='collapsible'][data-part='trigger'][hidden],
|
|
156
|
+
[data-scope='collapsible'][data-part='indicator'][hidden] {
|
|
112
157
|
display: none;
|
|
113
158
|
}
|
|
114
159
|
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-Present XiHanFun and contributors.
|
|
3
|
+
* Licensed under the MIT License. See LICENSE in the project root for license information.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* TextField 独立皮肤同时传递引入字段视觉盒与字段内动作;full bundle 递归去重。 */
|
|
7
|
+
@import '../family/field-chrome.css';
|
|
8
|
+
@import '../family/action-control.css';
|
|
9
|
+
@import '../family/swatch.css';
|
|
10
|
+
|
|
11
|
+
@layer xihan.components {
|
|
12
|
+
[data-scope='color-field'] {
|
|
13
|
+
--xh-color-field-skin: 1;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* 组件层只把既有公开槽映射到家族合同;形态三档由家族按 control 上的 data-variant 生成,皮肤不再声明;
|
|
17
|
+
色块吃 Swatch 家族,只在这里补一条与输入框的间距。 */
|
|
18
|
+
[data-scope='color-field'][data-part='root'] {
|
|
19
|
+
--xh-_color-field-h: var(--xh-control-h-md);
|
|
20
|
+
--xh-_color-field-px: var(--xh-control-px-md);
|
|
21
|
+
--xh-_color-field-gap: var(--xh-control-gap-md);
|
|
22
|
+
--xh-_color-field-font-size: var(--xh-control-font-md);
|
|
23
|
+
--xh-_color-field-action-font-size: var(--xh-control-caption-md);
|
|
24
|
+
|
|
25
|
+
--xh-icon-size: var(--xh-color-field-icon-size, var(--xh-glyph-size-md));
|
|
26
|
+
|
|
27
|
+
display: inline-flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
gap: var(--xh-color-field-gap, var(--xh-space-1));
|
|
30
|
+
/* 不传尺寸时一律这么宽,宽度不随内容走;父容器给不出这么宽时整件跟着收,地板同步让步,不越出父容器。
|
|
31
|
+
地板不高过缺省宽:使用者把缺省宽钉到底线以下时不必再放开底线 */
|
|
32
|
+
inline-size: var(--xh-color-field-control-w, var(--xh-control-w));
|
|
33
|
+
min-inline-size: min(var(--xh-color-field-control-w, var(--xh-control-w)), var(--xh-color-field-control-min-w, var(--xh-control-min-w)), 100%);
|
|
34
|
+
max-inline-size: 100%;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[data-scope='color-field'][data-part='root'][hidden] {
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
[data-scope='color-field'][data-part='root'][data-size='sm'] {
|
|
42
|
+
--xh-_color-field-h: var(--xh-control-h-sm);
|
|
43
|
+
--xh-_color-field-px: var(--xh-control-px-sm);
|
|
44
|
+
--xh-_color-field-gap: var(--xh-control-gap-sm);
|
|
45
|
+
--xh-_color-field-font-size: var(--xh-control-font-sm);
|
|
46
|
+
--xh-_color-field-action-font-size: var(--xh-control-caption-sm);
|
|
47
|
+
--xh-icon-size: var(--xh-color-field-icon-size, var(--xh-glyph-size-sm));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
[data-scope='color-field'][data-part='root'][data-size='lg'] {
|
|
51
|
+
--xh-_color-field-h: var(--xh-control-h-lg);
|
|
52
|
+
--xh-_color-field-px: var(--xh-control-px-lg);
|
|
53
|
+
--xh-_color-field-gap: var(--xh-control-gap-lg);
|
|
54
|
+
--xh-_color-field-font-size: var(--xh-control-font-lg);
|
|
55
|
+
--xh-_color-field-action-font-size: var(--xh-control-caption-lg);
|
|
56
|
+
--xh-icon-size: var(--xh-color-field-icon-size, var(--xh-glyph-size-lg));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
[data-scope='color-field'][data-part='label'] {
|
|
60
|
+
color: var(--xh-color-field-label-fg, var(--xh-fg-default));
|
|
61
|
+
font-size: var(--xh-color-field-label-font-size, var(--xh-text-label-size));
|
|
62
|
+
font-weight: var(--xh-color-field-label-font-weight, var(--xh-text-label-weight));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
[data-scope='color-field'][data-part='label'][data-disabled] {
|
|
66
|
+
color: var(--xh-color-field-label-fg-disabled, var(--xh-fg-subtle));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
[data-scope='color-field'][data-part='control'] {
|
|
70
|
+
--xh-field-control-height: var(--xh-color-field-control-h, var(--xh-_color-field-h));
|
|
71
|
+
--xh-field-control-padding-inline: var(--xh-color-field-control-px, var(--xh-_color-field-px));
|
|
72
|
+
--xh-field-control-gap: var(--xh-color-field-control-gap, var(--xh-_color-field-gap));
|
|
73
|
+
--xh-field-control-min-inline-size: var(--xh-color-field-control-min-w, var(--xh-control-min-w));
|
|
74
|
+
--xh-field-control-radius: var(--xh-color-field-control-radius, var(--xh-shape-control));
|
|
75
|
+
--xh-field-bg-rest: var(--xh-color-field-control-bg, var(--xh-_field-variant-bg-rest));
|
|
76
|
+
--xh-field-bg-hover: var(--xh-color-field-control-bg-hover, var(--xh-_field-variant-bg-hover));
|
|
77
|
+
--xh-field-bg-read-only: var(--xh-color-field-control-bg-readonly, var(--xh-_field-variant-bg-read-only));
|
|
78
|
+
--xh-field-bg-disabled: var(--xh-color-field-control-bg-disabled, var(--xh-_field-variant-bg-disabled));
|
|
79
|
+
--xh-field-fg-rest: var(--xh-color-field-control-fg, var(--xh-fg-default));
|
|
80
|
+
--xh-field-border-rest: var(--xh-color-field-control-border, var(--xh-_field-variant-border-rest));
|
|
81
|
+
--xh-field-border-hover: var(--xh-color-field-control-border-hover, var(--xh-_field-variant-border-hover));
|
|
82
|
+
--xh-field-border-focus: var(--xh-color-field-control-border-focus, var(--xh-_field-variant-border-focus));
|
|
83
|
+
--xh-field-border-invalid: var(--xh-color-field-control-border-invalid, var(--xh-_field-variant-border-invalid));
|
|
84
|
+
--xh-field-ring-focus: var(--xh-ring-focus);
|
|
85
|
+
--xh-field-ring-invalid: var(--xh-ring-invalid);
|
|
86
|
+
--xh-field-shadow-rest: var(--xh-color-field-control-shadow, none);
|
|
87
|
+
/* 家族 chrome 会重写 --xh-icon-size,使用者图标槽必须经桥接槽下发才能在盒内生效 */
|
|
88
|
+
--xh-field-glyph-size: var(--xh-color-field-icon-size, var(--xh-_field-size-glyph-size));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* 当前颜色的色块:棋盘格、颜色层、描边与尺寸档由 Swatch 家族画(节点带 data-xh-swatch),
|
|
92
|
+
组件层只把自己的公开槽映射到家族合同;它排在输入框前面,间距由 Field Chrome 的 gap 给 */
|
|
93
|
+
[data-scope='color-field'][data-part='swatch'] {
|
|
94
|
+
--xh-swatch-size: var(--xh-color-field-swatch-size, var(--xh-_swatch-size));
|
|
95
|
+
--xh-swatch-radius: var(--xh-color-field-swatch-radius, var(--xh-shape-inset));
|
|
96
|
+
--xh-swatch-border: var(--xh-color-field-swatch-border, var(--xh-border-default));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
[data-scope='color-field'][data-part='swatch'][data-disabled] {
|
|
100
|
+
opacity: var(--xh-state-disabled-opacity);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
[data-scope='color-field'][data-part='swatch'][hidden] {
|
|
104
|
+
display: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
[data-scope='color-field'][data-part='input'] {
|
|
108
|
+
--xh-field-input-fg: var(--xh-color-field-input-fg, var(--xh-fg-default));
|
|
109
|
+
--xh-field-input-font-size: var(--xh-color-field-input-font-size, var(--xh-_color-field-font-size));
|
|
110
|
+
--xh-field-placeholder-fg: var(--xh-color-field-placeholder-fg, var(--xh-fg-subtle));
|
|
111
|
+
--xh-field-autofill-bg: var(--xh-color-field-input-autofill-bg, var(--xh-bg-canvas));
|
|
112
|
+
--xh-field-autofill-fg: var(--xh-color-field-input-autofill-fg, var(--xh-fg-default));
|
|
113
|
+
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
[data-scope='color-field'][data-part='control'][hidden] {
|
|
117
|
+
display: none;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* clear 的视觉、悬停/按压阶梯与粗指针热区来自 field-inset ghost 档,组件只映射既有覆盖槽。 */
|
|
121
|
+
[data-scope='color-field'][data-part='clear-trigger'] {
|
|
122
|
+
--xh-action-visual-size: var(--xh-color-field-action-size, var(--xh-_action-profile-visual-size));
|
|
123
|
+
--xh-action-min-inline-size: var(--xh-color-field-action-size, var(--xh-_action-profile-visual-size));
|
|
124
|
+
--xh-action-radius: var(--xh-color-field-action-radius, var(--xh-shape-inset));
|
|
125
|
+
/* 底色阶梯由 ghost 档给(透明 → 100 → 200),使用者槽只作覆盖入口 */
|
|
126
|
+
--xh-action-bg-rest: var(--xh-color-field-action-bg, var(--xh-_action-variant-bg-rest));
|
|
127
|
+
--xh-action-bg-hover: var(--xh-color-field-action-bg-hover, var(--xh-_action-variant-bg-hover));
|
|
128
|
+
--xh-action-bg-pressed: var(--xh-color-field-action-bg-active, var(--xh-_action-variant-bg-pressed));
|
|
129
|
+
--xh-action-fg-rest: var(--xh-color-field-action-fg, var(--xh-fg-muted));
|
|
130
|
+
--xh-action-fg-hover: var(--xh-color-field-action-fg-hover, var(--xh-fg-default));
|
|
131
|
+
--xh-action-border-rest: transparent;
|
|
132
|
+
--xh-action-highlight-rest: transparent;
|
|
133
|
+
--xh-action-shadow-rest: none;
|
|
134
|
+
--xh-action-shadow-hover: none;
|
|
135
|
+
--xh-action-shadow-pressed: none;
|
|
136
|
+
--xh-action-font-size: var(--xh-color-field-action-font-size, var(--xh-_color-field-action-font-size));
|
|
137
|
+
/* 配方尚未把 profile 字形档灌进 --xh-icon-size,钮内字形先按 field-inset 档逐钮取值 */
|
|
138
|
+
--xh-icon-size: var(--xh-_action-profile-glyph-size);
|
|
139
|
+
|
|
140
|
+
border-width: 0;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
[data-scope='color-field'][data-part='clear-trigger'][hidden] {
|
|
144
|
+
display: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
[data-scope='color-field'][data-part='clear-trigger']:empty::before {
|
|
148
|
+
content: '';
|
|
149
|
+
display: inline-block;
|
|
150
|
+
inline-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
151
|
+
block-size: var(--xh-icon-size, var(--xh-glyph-size-text));
|
|
152
|
+
vertical-align: var(--xh-glyph-baseline-shift);
|
|
153
|
+
background-color: currentColor;
|
|
154
|
+
-webkit-mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
155
|
+
mask: var(--xh-glyph-mark-close) center / contain no-repeat;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
}
|