@xihan-ui/styles 3.0.0 → 3.2.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 +63 -0
- package/README.md +1 -1
- package/component-tokens.d.ts +29 -0
- package/components.tokens.json +683 -27
- package/css/alert.css +2 -2
- package/css/approval.css +4 -4
- package/css/button.css +9 -5
- package/css/calendar-picker.css +3 -3
- package/css/calendar-range-picker.css +7 -7
- package/css/carousel.css +45 -13
- package/css/cartesian-chart.css +11 -11
- package/css/cascader.css +10 -10
- package/css/citation.css +2 -2
- package/css/code-view.css +6 -6
- package/css/color-picker.css +81 -0
- package/css/color-swatch-picker.css +9 -4
- package/css/combobox.css +12 -4
- package/css/command.css +1 -1
- package/css/date-field.css +39 -0
- package/css/date-picker.css +86 -9
- package/css/date-range-picker.css +47 -7
- package/css/diff-view.css +8 -8
- package/css/field-array.css +1 -1
- package/css/field.css +4 -0
- package/css/file-upload.css +1 -1
- package/css/float-button.css +140 -27
- package/css/form.css +14 -6
- package/css/graph-chart.css +2 -2
- package/css/highlight.css +1 -1
- package/css/image.css +1 -1
- package/css/mention.css +1 -1
- package/css/message-feed.css +1 -1
- package/css/notification.css +26 -20
- package/css/number-field.css +18 -18
- package/css/page-header.css +2 -2
- package/css/password-input.css +2 -2
- package/css/popconfirm.css +3 -3
- package/css/question-flow.css +8 -8
- package/css/radar-chart.css +6 -6
- package/css/rating.css +1 -1
- package/css/select.css +2 -2
- package/css/separator.css +2 -2
- package/css/side-nav.css +13 -13
- package/css/skeleton.css +5 -5
- package/css/slider.css +6 -6
- package/css/sortable.css +2 -2
- package/css/table.css +19 -2
- package/css/tags-input.css +1 -1
- package/css/time-picker.css +59 -2
- package/css/tool-call.css +7 -7
- package/css/tooltip.css +1 -1
- package/css/tree-select.css +2 -2
- package/css/tree.css +81 -11
- package/dist/css/accordion.css +269 -0
- package/dist/css/affix.css +47 -0
- package/dist/css/alert.css +247 -0
- package/dist/css/anchor.css +252 -0
- package/dist/css/approval.css +501 -0
- package/dist/css/avatar-group.css +99 -0
- package/dist/css/avatar.css +98 -0
- package/dist/css/back-top.css +161 -0
- package/dist/css/badge.css +205 -0
- package/dist/css/bar-code.css +62 -0
- package/dist/css/breadcrumb.css +230 -0
- package/dist/css/button-group.css +263 -0
- package/dist/css/button.css +219 -0
- package/dist/css/calendar-picker.css +467 -0
- package/dist/css/calendar-range-picker.css +554 -0
- package/dist/css/card.css +221 -0
- package/dist/css/carousel.css +710 -0
- package/dist/css/cartesian-chart.css +830 -0
- package/dist/css/cascader.css +961 -0
- package/dist/css/checkbox-group.css +358 -0
- package/dist/css/checkbox.css +257 -0
- package/dist/css/citation.css +470 -0
- package/dist/css/clipboard.css +315 -0
- package/dist/css/code-view.css +374 -0
- package/dist/css/collapsible.css +185 -0
- package/dist/css/color-field.css +176 -0
- package/dist/css/color-picker.css +595 -0
- package/dist/css/color-slider.css +281 -0
- package/dist/css/color-swatch-picker.css +250 -0
- package/dist/css/color-swatch.css +35 -0
- package/dist/css/combobox.css +574 -0
- package/dist/css/command.css +399 -0
- package/dist/css/context-menu.css +420 -0
- package/dist/css/date-field.css +317 -0
- package/dist/css/date-picker.css +868 -0
- package/dist/css/date-range-picker.css +886 -0
- package/dist/css/description.css +67 -0
- package/dist/css/descriptions.css +299 -0
- package/dist/css/dialog.css +455 -0
- package/dist/css/diff-view.css +513 -0
- package/dist/css/download-trigger.css +151 -0
- package/dist/css/drawer.css +552 -0
- package/dist/css/editable.css +295 -0
- package/dist/css/empty-state.css +163 -0
- package/dist/css/field-array.css +226 -0
- package/dist/css/field.css +166 -0
- package/dist/css/fieldset.css +102 -0
- package/dist/css/file-upload.css +429 -0
- package/dist/css/flex.css +441 -0
- package/dist/css/float-button.css +569 -0
- package/dist/css/floating-panel.css +429 -0
- package/dist/css/focus.css +46 -0
- package/dist/css/forced-colors.css +93 -0
- package/dist/css/form.css +393 -0
- package/dist/css/funnel-chart.css +106 -0
- package/dist/css/graph-chart.css +205 -0
- package/dist/css/grid-list.css +235 -0
- package/dist/css/grid.css +1201 -0
- package/dist/css/heatmap.css +552 -0
- package/dist/css/hierarchy-chart.css +298 -0
- package/dist/css/highlight.css +41 -0
- package/dist/css/hover-card.css +226 -0
- package/dist/css/icon.css +225 -0
- package/dist/css/image-cropper.css +373 -0
- package/dist/css/image-viewer.css +538 -0
- package/dist/css/image.css +98 -0
- package/dist/css/infinite-scroll.css +77 -0
- package/dist/css/input-group.css +275 -0
- package/dist/css/json-viewer.css +379 -0
- package/dist/css/kbd.css +72 -0
- package/dist/css/label.css +78 -0
- package/dist/css/layers.css +7 -0
- package/dist/css/layout.css +372 -0
- package/dist/css/liquid.css +106 -0
- package/dist/css/list.css +152 -0
- package/dist/css/listbox.css +390 -0
- package/dist/css/loading-bar.css +141 -0
- package/dist/css/log.css +306 -0
- package/dist/css/markdown-stream.css +149 -0
- package/dist/css/marquee.css +378 -0
- package/dist/css/masonry.css +70 -0
- package/dist/css/matrix-code.css +67 -0
- package/dist/css/mention.css +393 -0
- package/dist/css/menu.css +364 -0
- package/dist/css/menubar.css +456 -0
- package/dist/css/message-feed.css +318 -0
- package/dist/css/navigation-menu.css +513 -0
- package/dist/css/notification.css +782 -0
- package/dist/css/number-animation.css +44 -0
- package/dist/css/number-field.css +252 -0
- package/dist/css/overlay-arrow.css +56 -0
- package/dist/css/page-header.css +184 -0
- package/dist/css/pagination.css +450 -0
- package/dist/css/password-input.css +391 -0
- package/dist/css/pie-chart.css +247 -0
- package/dist/css/pin-input.css +199 -0
- package/dist/css/pointer.css +36 -0
- package/dist/css/popconfirm.css +320 -0
- package/dist/css/popover.css +279 -0
- package/dist/css/progress.css +501 -0
- package/dist/css/prompt-input.css +260 -0
- package/dist/css/question-flow.css +553 -0
- package/dist/css/radar-chart.css +233 -0
- package/dist/css/radio-group.css +598 -0
- package/dist/css/rating.css +294 -0
- package/dist/css/reasoning.css +343 -0
- package/dist/css/reset.css +117 -0
- package/dist/css/resizable.css +242 -0
- package/dist/css/sankey-chart.css +174 -0
- package/dist/css/scroll-area.css +240 -0
- package/dist/css/scrollbar.css +204 -0
- package/dist/css/select.css +612 -0
- package/dist/css/separator.css +122 -0
- package/dist/css/side-nav.css +476 -0
- package/dist/css/signature-pad.css +179 -0
- package/dist/css/skeleton.css +161 -0
- package/dist/css/slider.css +374 -0
- package/dist/css/sortable.css +228 -0
- package/dist/css/sparkline.css +164 -0
- package/dist/css/spinner.css +236 -0
- package/dist/css/splitter.css +159 -0
- package/dist/css/statistic.css +137 -0
- package/dist/css/steps.css +627 -0
- package/dist/css/switch.css +351 -0
- package/dist/css/table.css +1145 -0
- package/dist/css/tabs.css +944 -0
- package/dist/css/tag-group.css +247 -0
- package/dist/css/tag.css +310 -0
- package/dist/css/tags-input.css +322 -0
- package/dist/css/text-field.css +197 -0
- package/dist/css/time-field.css +277 -0
- package/dist/css/time-picker.css +707 -0
- package/dist/css/time-range-picker.css +746 -0
- package/dist/css/timeline.css +423 -0
- package/dist/css/timer.css +123 -0
- package/dist/css/timestamp.css +34 -0
- package/dist/css/toggle-group.css +424 -0
- package/dist/css/toggle.css +146 -0
- package/dist/css/tone.css +189 -0
- package/dist/css/tool-call.css +429 -0
- package/dist/css/toolbar.css +365 -0
- package/dist/css/tooltip.css +218 -0
- package/dist/css/tour.css +439 -0
- package/dist/css/transfer.css +638 -0
- package/dist/css/tree-select.css +878 -0
- package/dist/css/tree.css +733 -0
- package/dist/css/truncate.css +108 -0
- package/dist/css/typography.css +472 -0
- package/dist/css/undefined.css +58 -0
- package/dist/css/virtualizer.css +166 -0
- package/dist/css/visually-hidden.css +20 -0
- package/dist/css/watermark.css +82 -0
- package/dist/family/action-control.css +487 -0
- package/dist/family/chart.css +480 -0
- package/dist/family/check-mark.css +94 -0
- package/dist/family/choice-card.css +97 -0
- package/dist/family/collection-item.css +764 -0
- package/dist/family/field-chrome.css +287 -0
- package/dist/family/loading-ring.css +95 -0
- package/dist/family/material.css +72 -0
- package/dist/family/menu-choice.css +56 -0
- package/dist/family/motion.css +363 -0
- package/dist/family/swatch.css +59 -0
- package/dist/family/tag-list.css +59 -0
- package/family/action-control.css +3 -12
- package/index.css +7307 -6759
- package/index.unlayered.css +7309 -6761
- package/package.json +165 -164
|
@@ -0,0 +1,423 @@
|
|
|
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
|
+
/* 定义 timeline 样式。 */
|
|
7
|
+
|
|
8
|
+
@layer xihan.components {
|
|
9
|
+
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
10
|
+
.xh-scope-timeline {
|
|
11
|
+
--xh-timeline-skin: 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.xh-scope-timeline[data-part='root'] {
|
|
15
|
+
/* 尺寸档只换这几个私有槽,条目、圆点与文字都从 root 继承它们,
|
|
16
|
+
换档不必给每个部件各写一条选择器 */
|
|
17
|
+
--xh-_timeline-dot-size: var(--xh-space-2_5);
|
|
18
|
+
--xh-_timeline-gutter: var(--xh-space-3);
|
|
19
|
+
--xh-_timeline-item-gap: var(--xh-space-5);
|
|
20
|
+
--xh-_timeline-title-font-size: var(--xh-control-font-md);
|
|
21
|
+
--xh-_timeline-caption-font-size: var(--xh-text-caption-size);
|
|
22
|
+
/* 标题首行占多高。圆点按它居中下移,圆心才落在标题这一行的中线上 */
|
|
23
|
+
--xh-_timeline-line-h: calc(
|
|
24
|
+
var(--xh-timeline-title-font-size, var(--xh-_timeline-title-font-size)) * var(--xh-leading-tight)
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
/* 条目之间不设 gap:留白由 content 自己的边距撑出来,连线才连得到下一条的圆点。
|
|
28
|
+
ol 的项目符号与内外边距是 UA 给的,库里没有全局 preflight,只能在这儿自己抹平 */
|
|
29
|
+
display: flex;
|
|
30
|
+
margin: 0;
|
|
31
|
+
padding: 0;
|
|
32
|
+
color: var(--xh-timeline-fg, var(--xh-fg-default));
|
|
33
|
+
list-style: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.xh-scope-timeline[data-part='root'][hidden] {
|
|
37
|
+
display: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.xh-scope-timeline[data-part='root'][data-orientation='vertical'] {
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* 横排排成一行、允许折行:窄档里每条占满整行,于是一条一行地堆下来。
|
|
45
|
+
朝向两档都是 row,换档换的是下面每条的 flex 基准 */
|
|
46
|
+
.xh-scope-timeline[data-part='root'][data-orientation='horizontal'] {
|
|
47
|
+
flex-direction: row;
|
|
48
|
+
flex-wrap: wrap;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* —— 尺寸 —— */
|
|
52
|
+
/* 缺省档写在上面的基础规则里。圆点直径不在控件高度那把尺上,三档走空间尺相邻的三格 */
|
|
53
|
+
.xh-scope-timeline[data-part='root'][data-size='sm'] {
|
|
54
|
+
--xh-_timeline-dot-size: var(--xh-space-2);
|
|
55
|
+
--xh-_timeline-gutter: var(--xh-space-2);
|
|
56
|
+
--xh-_timeline-item-gap: var(--xh-space-4);
|
|
57
|
+
--xh-_timeline-title-font-size: var(--xh-control-font-sm);
|
|
58
|
+
/* 字号档最小就是 xs,时刻文本不再往下走,故不重声明 caption */
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.xh-scope-timeline[data-part='root'][data-size='lg'] {
|
|
62
|
+
--xh-_timeline-dot-size: var(--xh-space-3);
|
|
63
|
+
--xh-_timeline-gutter: var(--xh-space-4);
|
|
64
|
+
--xh-_timeline-item-gap: var(--xh-space-6);
|
|
65
|
+
--xh-_timeline-title-font-size: var(--xh-control-font-lg);
|
|
66
|
+
--xh-_timeline-caption-font-size: var(--xh-text-secondary-size);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* —— 条目 —— */
|
|
70
|
+
/* 圆点与连线占一列,内容占另一列,用 grid 而不是再包一层节点:
|
|
71
|
+
解剖里没有那个包裹层,作者也不该被逼着多写一个 div。
|
|
72
|
+
这份两列的摆法是两个朝向共同的窄档,横排在下面的宽档里改写它 */
|
|
73
|
+
.xh-scope-timeline[data-part='item'] {
|
|
74
|
+
display: grid;
|
|
75
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
76
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
77
|
+
column-gap: var(--xh-timeline-gutter, var(--xh-_timeline-gutter));
|
|
78
|
+
/* 库里没有全局 preflight,列表项的外边距在这里自己抹平 */
|
|
79
|
+
margin: 0;
|
|
80
|
+
/* 允许被压缩,内容里的省略号才有生效的余地 */
|
|
81
|
+
min-inline-size: 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.xh-scope-timeline[data-part='item'][hidden] {
|
|
85
|
+
display: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* 横排的窄档:每条占满整行,一条一行地堆下来 */
|
|
89
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal'] {
|
|
90
|
+
flex: 0 0 100%;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* —— 圆点 —— */
|
|
94
|
+
.xh-scope-timeline[data-part='indicator'] {
|
|
95
|
+
display: flex;
|
|
96
|
+
flex: none;
|
|
97
|
+
align-items: center;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
inline-size: var(--xh-timeline-indicator-size, var(--xh-_timeline-dot-size));
|
|
100
|
+
block-size: var(--xh-timeline-indicator-size, var(--xh-_timeline-dot-size));
|
|
101
|
+
border-radius: var(--xh-timeline-indicator-radius, var(--xh-shape-circle));
|
|
102
|
+
/* 使用者令牌排在语气之前;两者都没有时退回一个中性的实心点 */
|
|
103
|
+
background: var(--xh-timeline-indicator-bg, var(--xh-_tone-soft, var(--xh-fg-muted)));
|
|
104
|
+
color: var(--xh-timeline-indicator-fg, var(--xh-_tone-on, var(--xh-fg-on-brand)));
|
|
105
|
+
font-size: var(--xh-timeline-indicator-font-size, var(--xh-_timeline-caption-font-size));
|
|
106
|
+
line-height: var(--xh-leading-none);
|
|
107
|
+
/* 语气色由每条自己的数据给,同一条的语气改了(事情办成了、出错了)走一遍过渡,
|
|
108
|
+
整列圆点不在数据回来的那一帧集体跳色 */
|
|
109
|
+
transition:
|
|
110
|
+
background-color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter),
|
|
111
|
+
color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.xh-scope-timeline[data-part='indicator'][hidden] {
|
|
115
|
+
display: none;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.xh-scope-timeline[data-part='item'] .xh-scope-timeline[data-part='indicator'] {
|
|
119
|
+
grid-column: 1;
|
|
120
|
+
grid-row: 1;
|
|
121
|
+
/* 行高减去直径的一半:calc 里的除法要写成乘 0.5,除号在这儿是无效语法 */
|
|
122
|
+
margin-block-start: calc(
|
|
123
|
+
(var(--xh-_timeline-line-h) - var(--xh-timeline-indicator-size, var(--xh-_timeline-dot-size))) * 0.5
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* —— 连线 —— */
|
|
128
|
+
.xh-scope-timeline[data-part='connector'] {
|
|
129
|
+
border-radius: var(--xh-timeline-connector-radius, var(--xh-shape-pill));
|
|
130
|
+
background: var(--xh-timeline-connector-bg, var(--xh-border-default));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.xh-scope-timeline[data-part='connector'][hidden] {
|
|
134
|
+
display: none;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* 堆叠时:从圆点下沿一直伸到条目底边,接上下一条的圆点。
|
|
138
|
+
min-block-size 兜住内容极短的条目,那时也还看得见一截线 */
|
|
139
|
+
.xh-scope-timeline[data-part='item'] .xh-scope-timeline[data-part='connector'] {
|
|
140
|
+
grid-column: 1;
|
|
141
|
+
grid-row: 2;
|
|
142
|
+
justify-self: center;
|
|
143
|
+
inline-size: var(--xh-timeline-connector-thickness, var(--xh-stroke-thick));
|
|
144
|
+
min-block-size: var(--xh-timeline-connector-min-length, var(--xh-space-4));
|
|
145
|
+
margin-block-start: var(--xh-space-1);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* 末条后面没有下一件事,那截线不该占地方;作者不写它也一样,写了就替他收掉 */
|
|
149
|
+
.xh-scope-timeline[data-part='item']:last-child .xh-scope-timeline[data-part='connector'] {
|
|
150
|
+
display: none;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* —— 内容 —— */
|
|
154
|
+
.xh-scope-timeline[data-part='content'] {
|
|
155
|
+
display: flex;
|
|
156
|
+
flex-direction: column;
|
|
157
|
+
gap: var(--xh-timeline-content-gap, var(--xh-space-1));
|
|
158
|
+
min-inline-size: 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.xh-scope-timeline[data-part='content'][hidden] {
|
|
162
|
+
display: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* 条目之间的留白由内容自己的边距撑出来,连线的那一列因此能一路连到下一条 */
|
|
166
|
+
.xh-scope-timeline[data-part='item'] .xh-scope-timeline[data-part='content'] {
|
|
167
|
+
grid-column: 2;
|
|
168
|
+
grid-row: 1 / -1;
|
|
169
|
+
padding-block-end: var(--xh-timeline-item-gap, var(--xh-_timeline-item-gap));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* 末条的留白同样收掉:它后面已经没有要隔开的东西 */
|
|
173
|
+
.xh-scope-timeline[data-part='item']:last-child .xh-scope-timeline[data-part='content'] {
|
|
174
|
+
padding-block-end: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* —— 侧别 —— */
|
|
178
|
+
/* 不写 placement 时内容落在结束侧,即上面那几条基础规则。
|
|
179
|
+
start 把线挪到结束侧、内容挪到起始侧,文字一并靠向线 */
|
|
180
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical'][data-placement='start'] {
|
|
181
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical'][data-placement='start'] .xh-scope-timeline[data-part='indicator'],
|
|
185
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical'][data-placement='start'] .xh-scope-timeline[data-part='connector'] {
|
|
186
|
+
grid-column: 2;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical'][data-placement='start'] .xh-scope-timeline[data-part='content'] {
|
|
190
|
+
grid-column: 1;
|
|
191
|
+
align-items: flex-end;
|
|
192
|
+
text-align: end;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* alternate:线走中间,奇数条在结束侧、偶数条在起始侧 */
|
|
196
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical'][data-placement='alternate'] {
|
|
197
|
+
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical'][data-placement='alternate'] .xh-scope-timeline[data-part='indicator'],
|
|
201
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical'][data-placement='alternate'] .xh-scope-timeline[data-part='connector'] {
|
|
202
|
+
grid-column: 2;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical'][data-placement='alternate'] .xh-scope-timeline[data-part='content'] {
|
|
206
|
+
grid-column: 3;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical'][data-placement='alternate']:nth-child(even) .xh-scope-timeline[data-part='content'] {
|
|
210
|
+
grid-column: 1;
|
|
211
|
+
align-items: flex-end;
|
|
212
|
+
text-align: end;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* —— 坐标 —— */
|
|
216
|
+
/* 与内容对置的那一列。竖排三种侧别各给它一条轨道,横排不单开轨道、按流排在末尾 */
|
|
217
|
+
.xh-scope-timeline[data-part='label'] {
|
|
218
|
+
grid-column: var(--xh-_timeline-label-col, auto);
|
|
219
|
+
grid-row: var(--xh-_timeline-label-row, auto);
|
|
220
|
+
align-self: start;
|
|
221
|
+
min-inline-size: 0;
|
|
222
|
+
color: var(--xh-timeline-label-fg, var(--xh-fg-subtle));
|
|
223
|
+
font-size: var(--xh-timeline-label-font-size, var(--xh-_timeline-caption-font-size));
|
|
224
|
+
/* 等宽数字:日期里的 1 与 7 在比例字体里宽度不同,不定住会让整列坐标左右抖一格 */
|
|
225
|
+
font-variant-numeric: tabular-nums;
|
|
226
|
+
line-height: var(--xh-leading-tight);
|
|
227
|
+
text-align: var(--xh-_timeline-label-align, end);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* 内容落在结束侧时坐标占线之前的那一列,圆点与连线让到第二列 */
|
|
231
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical']:where(:not([data-placement]), [data-placement='end']):has(> .xh-scope-timeline[data-part='label']) {
|
|
232
|
+
--xh-_timeline-label-col: 1;
|
|
233
|
+
--xh-_timeline-label-row: 1;
|
|
234
|
+
|
|
235
|
+
grid-template-columns: auto auto minmax(0, 1fr);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical']:where(:not([data-placement]), [data-placement='end']):has(> .xh-scope-timeline[data-part='label']) > .xh-scope-timeline[data-part='indicator'],
|
|
239
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical']:where(:not([data-placement]), [data-placement='end']):has(> .xh-scope-timeline[data-part='label']) > .xh-scope-timeline[data-part='connector'] {
|
|
240
|
+
grid-column: 2;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical']:where(:not([data-placement]), [data-placement='end']):has(> .xh-scope-timeline[data-part='label']) > .xh-scope-timeline[data-part='content'] {
|
|
244
|
+
grid-column: 3;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/* 横排的窄档摆成上下两格,坐标照竖排那样占线之前的一列。
|
|
248
|
+
不给这条轨道的话坐标会自动落进圆点那一列,把它撑宽,圆点与连线因此错开 */
|
|
249
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal']:has(> .xh-scope-timeline[data-part='label']) {
|
|
250
|
+
--xh-_timeline-label-col: 1;
|
|
251
|
+
--xh-_timeline-label-row: 1;
|
|
252
|
+
|
|
253
|
+
grid-template-columns: auto auto minmax(0, 1fr);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal']:has(> .xh-scope-timeline[data-part='label']) > .xh-scope-timeline[data-part='indicator'],
|
|
257
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal']:has(> .xh-scope-timeline[data-part='label']) > .xh-scope-timeline[data-part='connector'] {
|
|
258
|
+
grid-column: 2;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal']:has(> .xh-scope-timeline[data-part='label']) > .xh-scope-timeline[data-part='content'] {
|
|
262
|
+
grid-column: 3;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/* 内容落在起始侧时坐标占线之后的那一列 */
|
|
266
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical'][data-placement='start']:has(> .xh-scope-timeline[data-part='label']) {
|
|
267
|
+
--xh-_timeline-label-col: 3;
|
|
268
|
+
--xh-_timeline-label-row: 1;
|
|
269
|
+
--xh-_timeline-label-align: start;
|
|
270
|
+
|
|
271
|
+
grid-template-columns: minmax(0, 1fr) auto auto;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/* 逐条交替时坐标恒在内容的对面,时间戳因此不跟着内容左右横跳 */
|
|
275
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical'][data-placement='alternate'] {
|
|
276
|
+
--xh-_timeline-label-col: 1;
|
|
277
|
+
--xh-_timeline-label-row: 1;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.xh-scope-timeline[data-part='item'][data-orientation='vertical'][data-placement='alternate']:nth-child(even) {
|
|
281
|
+
--xh-_timeline-label-col: 3;
|
|
282
|
+
--xh-_timeline-label-align: start;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/* —— 横排的宽档 —— */
|
|
286
|
+
/* 上面那份两列的摆法是两个朝向共同的窄档。视口宽到放得下一行事件时,
|
|
287
|
+
横排在这里把圆点与连线转回同一行、内容落到下一行。
|
|
288
|
+
手机档停在窄档:一条一行,事件仍逐条读得完 */
|
|
289
|
+
@media (min-width: 768px) {
|
|
290
|
+
/* 每条等分整行 */
|
|
291
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal'] {
|
|
292
|
+
flex: 1;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/* 每条规则都带一条 :has(坐标) 的分支:窄档那条坐标轨道的选择器更重,
|
|
296
|
+
不把它写进来的话带坐标的那些条目会停在窄档的摆法上 */
|
|
297
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal'] .xh-scope-timeline[data-part='indicator'],
|
|
298
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal']:has(> .xh-scope-timeline[data-part='label']) > .xh-scope-timeline[data-part='indicator'] {
|
|
299
|
+
grid-column: 1;
|
|
300
|
+
grid-row: 1;
|
|
301
|
+
/* 圆点与内容不再上下对位,窄档那半行的下移收掉 */
|
|
302
|
+
margin-block-start: 0;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/* 线转成横的一条,与圆点同一行;窄档那几条竖着走的取值一并收掉 */
|
|
306
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal'] .xh-scope-timeline[data-part='connector'],
|
|
307
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal']:has(> .xh-scope-timeline[data-part='label']) > .xh-scope-timeline[data-part='connector'] {
|
|
308
|
+
grid-column: 2;
|
|
309
|
+
grid-row: 1;
|
|
310
|
+
align-self: center;
|
|
311
|
+
justify-self: stretch;
|
|
312
|
+
inline-size: auto;
|
|
313
|
+
min-inline-size: var(--xh-timeline-connector-min-length, var(--xh-space-4));
|
|
314
|
+
block-size: var(--xh-timeline-connector-thickness, var(--xh-stroke-thick));
|
|
315
|
+
min-block-size: 0;
|
|
316
|
+
margin-block-start: 0;
|
|
317
|
+
margin-inline-start: var(--xh-space-1);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal'] .xh-scope-timeline[data-part='content'],
|
|
321
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal']:has(> .xh-scope-timeline[data-part='label']) > .xh-scope-timeline[data-part='content'] {
|
|
322
|
+
grid-column: 1 / -1;
|
|
323
|
+
grid-row: 2;
|
|
324
|
+
padding-block-start: var(--xh-timeline-content-pt, var(--xh-space-2));
|
|
325
|
+
padding-block-end: 0;
|
|
326
|
+
padding-inline-end: var(--xh-timeline-item-gap, var(--xh-_timeline-item-gap));
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/* 末条的留白同样收掉:它后面已经没有要隔开的东西 */
|
|
330
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal']:last-child .xh-scope-timeline[data-part='content'] {
|
|
331
|
+
padding-inline-end: 0;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/* 宽档不给坐标单开轨道,它按流排在末尾;窄档那条轨道在这里收掉 */
|
|
335
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal']:has(> .xh-scope-timeline[data-part='label']) {
|
|
336
|
+
--xh-_timeline-label-col: auto;
|
|
337
|
+
--xh-_timeline-label-row: auto;
|
|
338
|
+
|
|
339
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/* 横排的 start 是把内容挪到线的上方,内容贴着线的那一边对齐 */
|
|
343
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal'][data-placement='start'] {
|
|
344
|
+
grid-template-rows: minmax(0, 1fr) auto;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal'][data-placement='start'] .xh-scope-timeline[data-part='indicator'],
|
|
348
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal'][data-placement='start'] .xh-scope-timeline[data-part='connector'] {
|
|
349
|
+
grid-row: 2;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal'][data-placement='start'] .xh-scope-timeline[data-part='content'] {
|
|
353
|
+
grid-row: 1;
|
|
354
|
+
align-self: end;
|
|
355
|
+
padding-block-start: 0;
|
|
356
|
+
padding-block-end: var(--xh-timeline-content-pb, var(--xh-space-2));
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal'][data-placement='alternate'] {
|
|
360
|
+
grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal'][data-placement='alternate'] .xh-scope-timeline[data-part='indicator'],
|
|
364
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal'][data-placement='alternate'] .xh-scope-timeline[data-part='connector'] {
|
|
365
|
+
grid-row: 2;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal'][data-placement='alternate'] .xh-scope-timeline[data-part='content'] {
|
|
369
|
+
grid-row: 3;
|
|
370
|
+
align-self: start;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.xh-scope-timeline[data-part='item'][data-orientation='horizontal'][data-placement='alternate']:nth-child(even) .xh-scope-timeline[data-part='content'] {
|
|
374
|
+
grid-row: 1;
|
|
375
|
+
align-self: end;
|
|
376
|
+
padding-block-start: 0;
|
|
377
|
+
padding-block-end: var(--xh-timeline-content-pb, var(--xh-space-2));
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/* —— 文字 —— */
|
|
382
|
+
/* 中间没有断点的长串——单号、路径、无空格的标识——在框内断开。
|
|
383
|
+
每条的宽度由内容的最小宽度定,断不开就会把整条轴顶出容器 */
|
|
384
|
+
.xh-scope-timeline:is([data-part='title'], [data-part='description'], [data-part='time'], [data-part='label']) {
|
|
385
|
+
overflow-wrap: anywhere;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.xh-scope-timeline[data-part='title'] {
|
|
389
|
+
color: var(--xh-timeline-title-fg, var(--xh-fg-default));
|
|
390
|
+
font-size: var(--xh-timeline-title-font-size, var(--xh-_timeline-title-font-size));
|
|
391
|
+
font-weight: var(--xh-timeline-title-font-weight, var(--xh-text-label-weight));
|
|
392
|
+
line-height: var(--xh-leading-tight);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.xh-scope-timeline[data-part='description'] {
|
|
396
|
+
color: var(--xh-timeline-description-fg, var(--xh-fg-muted));
|
|
397
|
+
font-size: var(--xh-timeline-description-font-size, var(--xh-text-secondary-size));
|
|
398
|
+
line-height: var(--xh-leading-normal);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.xh-scope-timeline[data-part='time'] {
|
|
402
|
+
color: var(--xh-timeline-time-fg, var(--xh-fg-subtle));
|
|
403
|
+
font-size: var(--xh-timeline-time-font-size, var(--xh-_timeline-caption-font-size));
|
|
404
|
+
/* 等宽数字:时刻里的 1 与 7 在比例字体里宽度不同,不定住会让整列时间左右抖一格 */
|
|
405
|
+
font-variant-numeric: tabular-nums;
|
|
406
|
+
line-height: var(--xh-leading-normal);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/*
|
|
410
|
+
* 打印:底色被丢掉,圆点与连线整个是底色画出来的,纸上这条轴的骨架就此不见,
|
|
411
|
+
* 只剩几段没有次序的文字。两处都改由描边承载:圆点成一个空心圈,
|
|
412
|
+
* 连线的两条边合起来就是那条线(线本身只有一个描边厚,两边各画一半正好填满)。
|
|
413
|
+
*/
|
|
414
|
+
@media print {
|
|
415
|
+
.xh-scope-timeline[data-part='indicator'] {
|
|
416
|
+
border: var(--xh-stroke-thick) solid currentColor;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.xh-scope-timeline[data-part='connector'] {
|
|
420
|
+
border: var(--xh-stroke-thin) solid currentColor;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
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
|
+
/* 定义 timer 样式。 */
|
|
7
|
+
|
|
8
|
+
/* Timer 独立皮肤同时传递引入起停钮的动作控件配方;full bundle 递归去重。 */
|
|
9
|
+
@import '../family/action-control.css';
|
|
10
|
+
|
|
11
|
+
@layer xihan.components {
|
|
12
|
+
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
13
|
+
.xh-scope-timer {
|
|
14
|
+
--xh-timer-skin: 1;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* 三个尺寸档只换这两个私有槽,各部件从 root 继承它们,换档不必给每个部件各写一条选择器;
|
|
18
|
+
起停钮的档位由连接层直接投给家族,这里不再中转 */
|
|
19
|
+
.xh-scope-timer[data-part='root'] {
|
|
20
|
+
--xh-_timer-digit-size: var(--xh-text-heading-2-size);
|
|
21
|
+
--xh-_timer-gap: var(--xh-space-3);
|
|
22
|
+
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: var(--xh-timer-gap, var(--xh-_timer-gap));
|
|
26
|
+
color: var(--xh-timer-fg, var(--xh-fg-default));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* 上面声明了 display,会盖掉 UA 的 [hidden] 规则,收起态要在这里接回来 */
|
|
30
|
+
.xh-scope-timer[data-part='root'][hidden] {
|
|
31
|
+
display: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* —— 尺寸 —— */
|
|
35
|
+
.xh-scope-timer[data-part='root'][data-size='sm'] {
|
|
36
|
+
--xh-_timer-digit-size: var(--xh-text-heading-3-size);
|
|
37
|
+
--xh-_timer-gap: var(--xh-space-2);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.xh-scope-timer[data-part='root'][data-size='lg'] {
|
|
41
|
+
--xh-_timer-digit-size: var(--xh-text-heading-1-size);
|
|
42
|
+
--xh-_timer-gap: var(--xh-space-4);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* —— 时间区 —— */
|
|
46
|
+
/* 等宽数字:逐位宽度一致,秒数换位时分隔符与后面的段都不会左右挪动。
|
|
47
|
+
direction 钉成 ltr:每段是一个独立的 flex 项,主轴方向跟着文字方向走,
|
|
48
|
+
不钉住的话 rtl 页面上时分秒会整体倒过来排——时间串的读序两个方向都一样。 */
|
|
49
|
+
.xh-scope-timer[data-part='display'] {
|
|
50
|
+
display: inline-flex;
|
|
51
|
+
align-items: baseline;
|
|
52
|
+
direction: ltr;
|
|
53
|
+
color: var(--xh-timer-display-fg, var(--xh-fg-default));
|
|
54
|
+
/* 嵌在一句话里或摆在别人的数值槽里时把 --xh-timer-digit-font-size 写成 inherit,
|
|
55
|
+
数字就跟着上下文的字号走,不再自带展示档字号 */
|
|
56
|
+
font-size: var(--xh-timer-digit-font-size, var(--xh-_timer-digit-size));
|
|
57
|
+
font-variant-numeric: tabular-nums;
|
|
58
|
+
font-weight: var(--xh-font-weight-semibold);
|
|
59
|
+
line-height: var(--xh-leading-tight);
|
|
60
|
+
/* 走到点那一刻前景退一档,这里让它淡过去而不是硬跳 */
|
|
61
|
+
transition: color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.xh-scope-timer[data-part='display'][hidden] {
|
|
65
|
+
display: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* 走完之后这串数字不再是活的信息,退一档;暂停在半路的仍是要盯着看的数,不退 */
|
|
69
|
+
.xh-scope-timer[data-part='display'][data-state='completed'] {
|
|
70
|
+
color: var(--xh-timer-completed-fg, var(--xh-fg-muted));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* 数字段自己一个前景槽,与记号那个成对。
|
|
74
|
+
缺省是 inherit 而不是某个具体前景:时间区走完会整体退一档,
|
|
75
|
+
数字段照着继承下来才跟得上,写死取值就跟不动了 */
|
|
76
|
+
.xh-scope-timer[data-part='item'] {
|
|
77
|
+
color: var(--xh-timer-item-fg, inherit);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* 记号只是排版,比数字弱一档、两侧留一点气口 */
|
|
81
|
+
.xh-scope-timer[data-part='separator'] {
|
|
82
|
+
padding-inline: var(--xh-timer-separator-px, var(--xh-space-0_5));
|
|
83
|
+
color: var(--xh-timer-separator-fg, var(--xh-fg-subtle));
|
|
84
|
+
font-weight: var(--xh-font-weight-regular);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* —— 起停按钮 ——
|
|
88
|
+
带文案(或图标)的离散动作钮:盒几何、悬停 / 按下与 0.97 按压、粗指针热区、焦点环、禁用面全由
|
|
89
|
+
Action Control 的 text outline 档给(连接层按 size 投档,缺省 md 一个控件高),组件只映射既有使用者槽。
|
|
90
|
+
中性描边、透明底;白底承载 hover 100 → pressed 200,不抬升;焦点边由家族给,不随语气 */
|
|
91
|
+
.xh-scope-timer[data-part='control'] {
|
|
92
|
+
--xh-action-visual-size: var(--xh-timer-control-h, var(--xh-_action-profile-visual-size));
|
|
93
|
+
--xh-action-padding-inline: var(--xh-timer-control-px, var(--xh-_action-profile-padding-inline));
|
|
94
|
+
--xh-action-gap: var(--xh-timer-control-gap, var(--xh-_action-profile-gap));
|
|
95
|
+
--xh-action-radius: var(--xh-timer-control-radius, var(--xh-shape-control));
|
|
96
|
+
--xh-action-bg-rest: var(--xh-timer-control-bg, var(--xh-_action-variant-bg-rest));
|
|
97
|
+
--xh-action-bg-hover: var(--xh-timer-control-bg-hover, var(--xh-_action-variant-bg-hover));
|
|
98
|
+
--xh-action-bg-pressed: var(--xh-timer-control-bg-active, var(--xh-_action-variant-bg-pressed));
|
|
99
|
+
--xh-action-bg-disabled: var(--xh-timer-control-bg-disabled, var(--xh-_action-variant-bg-disabled));
|
|
100
|
+
--xh-action-fg-rest: var(--xh-timer-control-fg, var(--xh-_action-variant-fg-rest));
|
|
101
|
+
--xh-action-fg-hover: var(--xh-timer-control-fg, var(--xh-_action-variant-fg-hover));
|
|
102
|
+
--xh-action-fg-pressed: var(--xh-timer-control-fg, var(--xh-_action-variant-fg-pressed));
|
|
103
|
+
--xh-action-border-rest: var(--xh-timer-control-border, var(--xh-_action-variant-border-rest));
|
|
104
|
+
--xh-action-border-hover: var(--xh-timer-control-border-hover, var(--xh-_action-variant-border-hover));
|
|
105
|
+
--xh-action-border-pressed: var(--xh-timer-control-border-hover, var(--xh-_action-variant-border-pressed));
|
|
106
|
+
--xh-action-border-focus-visible: var(--xh-timer-control-border-focus, var(--xh-_action-variant-border-focus-visible));
|
|
107
|
+
--xh-action-border-disabled: var(--xh-timer-control-border-disabled, var(--xh-_action-variant-border-disabled));
|
|
108
|
+
--xh-action-highlight-rest: transparent;
|
|
109
|
+
--xh-action-shadow-rest: none;
|
|
110
|
+
--xh-action-shadow-hover: var(--xh-timer-control-shadow-hover, none);
|
|
111
|
+
--xh-action-shadow-pressed: var(--xh-timer-control-shadow-active, none);
|
|
112
|
+
--xh-action-font-size: var(--xh-text-label-size);
|
|
113
|
+
/* 作者塞进钮里的图标按档取字形尺寸,与文案同一把尺 */
|
|
114
|
+
--xh-icon-size: var(--xh-timer-icon-size, var(--xh-_action-profile-glyph-size));
|
|
115
|
+
|
|
116
|
+
font-weight: var(--xh-text-label-weight);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* 家族那条 display 会把 UA 的 [hidden]{display:none} 盖掉,作者收起它时要的是这一条 */
|
|
120
|
+
.xh-scope-timer[data-part='control'][hidden] {
|
|
121
|
+
display: none;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
/* 定义 timestamp 样式。 */
|
|
7
|
+
|
|
8
|
+
@layer xihan.components {
|
|
9
|
+
/* 皮肤在场的标记:开发模式下按 scope 探一次,取不到就说明这份皮肤没被引入。 */
|
|
10
|
+
.xh-scope-timestamp {
|
|
11
|
+
--xh-timestamp-skin: 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.xh-scope-timestamp[data-part='root'] {
|
|
15
|
+
color: var(--xh-timestamp-fg, var(--xh-fg-default));
|
|
16
|
+
/* 等宽数字:秒数跳动时后面的字符不会左右挪 */
|
|
17
|
+
font-variant-numeric: tabular-nums;
|
|
18
|
+
/* 一个时间戳不该被拆到两行去 */
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
/* 时刻换成认不出的值时前景要换档,这里让它淡过去而不是硬跳 */
|
|
21
|
+
transition: color var(--xh-motion-duration-micro) var(--xh-motion-ease-enter);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* 相对说法是一句话不是一串数字,等宽数字反而把字距拉开 */
|
|
25
|
+
.xh-scope-timestamp[data-part='root'][data-relative] {
|
|
26
|
+
font-variant-numeric: normal;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* 没给时刻、或给了认不出的时刻:这时显示的是作者写在节点里的兜底文案,退成弱前景 */
|
|
30
|
+
.xh-scope-timestamp[data-part='root'][data-state='empty'],
|
|
31
|
+
.xh-scope-timestamp[data-part='root'][data-state='invalid'] {
|
|
32
|
+
color: var(--xh-timestamp-placeholder-fg, var(--xh-fg-muted));
|
|
33
|
+
}
|
|
34
|
+
}
|