@anyblock/any-block-core 3.4.6
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/ABAlias.ts +298 -0
- package/ABConvertEvent.ts +307 -0
- package/ABConvertManager.ts +266 -0
- package/ABSetting.ts +114 -0
- package/LICENSE +661 -0
- package/README.md +162 -0
- package/converter/ABConvert.ts +158 -0
- package/converter/GeneratorDataTable.ts +40 -0
- package/converter/abc_c2list.ts +497 -0
- package/converter/abc_code.ts +93 -0
- package/converter/abc_deco.ts +793 -0
- package/converter/abc_dir_tree.ts +467 -0
- package/converter/abc_echarts.ts +539 -0
- package/converter/abc_ex.ts +112 -0
- package/converter/abc_list.ts +650 -0
- package/converter/abc_markmap.ts +119 -0
- package/converter/abc_mdit_container.ts +161 -0
- package/converter/abc_mermaid.ts +343 -0
- package/converter/abc_plantuml.ts +109 -0
- package/converter/abc_plantuml_tools.ts +236 -0
- package/converter/abc_table.ts +242 -0
- package/converter/abc_text.ts +237 -0
- package/demo.ts +236 -0
- package/index.min.ts +26 -0
- package/index.ts +26 -0
- package/locales/en.ts +88 -0
- package/locales/helper.ts +27 -0
- package/locales/zh-cn.ts +88 -0
- package/package.json +22 -0
- package/setting.ts +0 -0
- package/style/styles.css +1218 -0
- package/style/styles.min.css +1 -0
- package/style/styles.scss +1244 -0
|
@@ -0,0 +1,1244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ABC 样式文件
|
|
3
|
+
*
|
|
4
|
+
* 修改/使用说明:
|
|
5
|
+
*
|
|
6
|
+
* vuepress-mdit环境直接用scss,ob这边需要使用css
|
|
7
|
+
* 编辑ABC模块的该文件时,需要手动编译/使用vscode `easy sass` 插件
|
|
8
|
+
*
|
|
9
|
+
* 换行问题:AnyBlock的块宽度很多都是不满100%的,在窄区域中显示多文本时经常需要使用换行
|
|
10
|
+
* - 不换行时
|
|
11
|
+
* - white-space: pre; // 有换行符要换
|
|
12
|
+
* - 换行时
|
|
13
|
+
* - white-space: break-spaces; // 自动换行 ~normal~~
|
|
14
|
+
* - overflow-wrap: break-word; // 单词中换行
|
|
15
|
+
* - code {white-space: pre;} // 一个用于手动控制不换行的方式
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* 颜色相关
|
|
20
|
+
*/
|
|
21
|
+
:root {
|
|
22
|
+
--ab-tab-root-bg-color: #0d1117; // #ffffff;
|
|
23
|
+
--ab-tab-root-bd-color: #34343f; // #e0e0e0;
|
|
24
|
+
--ab-tab-root-hv-color: #363639; // #D7D7D7 hover
|
|
25
|
+
--ab-tab-root-tx-color: #9e9e9e; // blackc
|
|
26
|
+
|
|
27
|
+
--ab-bright-color: orange; // lightgoldenrodyellow、yellowgreen
|
|
28
|
+
--pre-background-color: #1b1b1b; // rgb(36,36,36)
|
|
29
|
+
|
|
30
|
+
--ab-table-border-width: 1px;
|
|
31
|
+
--ab-table-border-color: #363636;
|
|
32
|
+
|
|
33
|
+
--ab-width-inner: 100%;
|
|
34
|
+
--ab-width-outer: 100%;
|
|
35
|
+
}
|
|
36
|
+
// 获取一些Obsidian的默认颜色并覆盖默认颜色 (mdit不可用)
|
|
37
|
+
.theme-dark,
|
|
38
|
+
.theme-light{
|
|
39
|
+
--ab-tab-root-bg-color: var(--color-base-00);
|
|
40
|
+
--ab-tab-root-bd-color: var(--color-base-30);
|
|
41
|
+
--ab-tab-root-tx-color: var(--color-base-70);
|
|
42
|
+
|
|
43
|
+
--ab-bright-color: var(--blockquote-border-color); // 不一定是主题色
|
|
44
|
+
--pre-background-color: var(--secondary-background);
|
|
45
|
+
|
|
46
|
+
--ab-table-border-width: var(--table-border-width);
|
|
47
|
+
--ab-table-border-color: var(--table-border-color);
|
|
48
|
+
}
|
|
49
|
+
.theme-light{
|
|
50
|
+
--ab-tab-root-hv-color: #d7d7d7;
|
|
51
|
+
}
|
|
52
|
+
// 获取VuePress的默认颜色并覆盖默认颜色
|
|
53
|
+
html[data-theme="light"] #app,
|
|
54
|
+
html[data-theme="dark"] #app{
|
|
55
|
+
--ab-tab-root-bg-color: var(--vp-c-bg); // --code-bg-color, old version vp: --bg-color
|
|
56
|
+
--ab-tab-root-bd-color: var(--vp-c-border); // --code-border-color, old version vp: --border-color
|
|
57
|
+
--ab-tab-root-tx-color: var(--vp-c-text); // --code-color, old version vp: --text-color
|
|
58
|
+
|
|
59
|
+
--ab-bright-color: var(--vp-c-accent); // old version vp:--theme-color
|
|
60
|
+
--pre-background-color: var(--code-bg-color);
|
|
61
|
+
}
|
|
62
|
+
html[data-theme="light"] #app {
|
|
63
|
+
--color-red: #e93147;
|
|
64
|
+
--color-orange: #ec7500;
|
|
65
|
+
--color-yellow: #e0ac00;
|
|
66
|
+
--color-green: #08b94e;
|
|
67
|
+
--color-cyan: #00bfbc;
|
|
68
|
+
--color-blue: #086ddd;
|
|
69
|
+
--color-purple: #7852ee;
|
|
70
|
+
--color-pink: #d53984;
|
|
71
|
+
--ab-tab-root-hv-color: #d7d7d7;
|
|
72
|
+
}
|
|
73
|
+
html[data-theme="dark"] #app {
|
|
74
|
+
--color-red: #fb464c;
|
|
75
|
+
--color-orange: #e9973f;
|
|
76
|
+
--color-yellow: #e0de71;
|
|
77
|
+
--color-green: #44cf6e;
|
|
78
|
+
--color-cyan: #53dfdd;
|
|
79
|
+
--color-blue: #027aff;
|
|
80
|
+
--color-purple: #a882ff;
|
|
81
|
+
--color-pink: #fa99cd;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ab-hide {
|
|
85
|
+
display: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* obsidian各模式下的微调
|
|
90
|
+
*
|
|
91
|
+
* 替换内容
|
|
92
|
+
* .ab-replace // 整体 (外框、圆角)
|
|
93
|
+
* &>.ab-note // 内容
|
|
94
|
+
* &>.ab-replaceEl // 内容 (感觉冗余了)
|
|
95
|
+
* &>.ab-button // 操作控件 (刷新/编辑/下拉框)
|
|
96
|
+
*/
|
|
97
|
+
.app-container {
|
|
98
|
+
// 阅读模式
|
|
99
|
+
.markdown-reading-view {
|
|
100
|
+
.ab-replace{
|
|
101
|
+
margin-top: 0;
|
|
102
|
+
margin-bottom: 22px;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// 源码/实时模式
|
|
106
|
+
.markdown-source-view {
|
|
107
|
+
.ab-replace{
|
|
108
|
+
// 消除cm-widgetBuffer自带的间隙。注意:不能完全消除,否则光标上下移动时会跳过块区域到达另一端
|
|
109
|
+
margin-top: -0.5em; // -12px;
|
|
110
|
+
margin-bottom: -0.5em; // -12px;
|
|
111
|
+
}
|
|
112
|
+
.block-language-anyblock>.ab-replace {
|
|
113
|
+
margin-top: 0;
|
|
114
|
+
margin-bottom: 0;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// 实时模式下的阅读模式(片段引用显示就是这种情况,覆盖掉前面的margin)
|
|
118
|
+
.markdown-source-view .markdown-preview-view {
|
|
119
|
+
.ab-replace{
|
|
120
|
+
margin-top: 0;
|
|
121
|
+
margin-bottom: 22px;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// 源码模式
|
|
125
|
+
.markdown-source-view.is-live-preview {}
|
|
126
|
+
}
|
|
127
|
+
// 打印/pdf模式
|
|
128
|
+
.print{
|
|
129
|
+
.ab-replace>.ab-button { // 刷新按钮
|
|
130
|
+
display: none;
|
|
131
|
+
}
|
|
132
|
+
.ab-replaceEl>button { // dir的折叠按钮
|
|
133
|
+
display: none;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// 手机/触屏端 mobile
|
|
137
|
+
// 弃用,使用另一个修复方法:移动端不给edit-block-button类
|
|
138
|
+
// @media (hover: none) and (pointer: coarse) {
|
|
139
|
+
// .edit-block-button.ab-button-1 { // 编辑按钮恒显示,要覆盖edit-block-button默认行为
|
|
140
|
+
// display: block !important;
|
|
141
|
+
// z-index: 20;
|
|
142
|
+
// }
|
|
143
|
+
// }
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* 替换内容
|
|
147
|
+
* .ab-replace // 整体 (外框、圆角)
|
|
148
|
+
* &>.ab-note // id (仅调试模式用)
|
|
149
|
+
* &>.ab-note // 内容
|
|
150
|
+
* &>.ab-replaceEl // 内容 (感觉冗余了)
|
|
151
|
+
* &>.ab-button // 操作控件 (刷新/编辑/下拉框)
|
|
152
|
+
*/
|
|
153
|
+
.ab-replace{
|
|
154
|
+
/*background-color: #272e3a;*/
|
|
155
|
+
position: relative;
|
|
156
|
+
border-radius: 4px;
|
|
157
|
+
|
|
158
|
+
&>.ab-id {
|
|
159
|
+
position: absolute;
|
|
160
|
+
top: 0;
|
|
161
|
+
left: 0;
|
|
162
|
+
display: inline-block;
|
|
163
|
+
height: 18px;
|
|
164
|
+
width: auto;
|
|
165
|
+
background: var(--ab-tab-root-bg-color);
|
|
166
|
+
color: var(--ab-tab-root-tx-color);
|
|
167
|
+
border-radius: 8px;
|
|
168
|
+
padding: 0 8px;
|
|
169
|
+
z-index: 10;
|
|
170
|
+
opacity: 0.8;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&>.ab-note{
|
|
174
|
+
position: relative;
|
|
175
|
+
/*padding: 24px 12px 12px 12px;*/
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&>.ab-button{
|
|
179
|
+
box-sizing: border-box;
|
|
180
|
+
position: absolute;
|
|
181
|
+
top: 4px;
|
|
182
|
+
&.ab-button-1 {
|
|
183
|
+
right: 4px;
|
|
184
|
+
}
|
|
185
|
+
&.ab-button-2 {
|
|
186
|
+
right: 40px; // +36
|
|
187
|
+
}
|
|
188
|
+
&.ab-button-3 {
|
|
189
|
+
right: 76px;
|
|
190
|
+
}
|
|
191
|
+
&.ab-button-4 {
|
|
192
|
+
right: 112px;
|
|
193
|
+
}
|
|
194
|
+
&.ab-button-5 {
|
|
195
|
+
right: 148px;
|
|
196
|
+
}
|
|
197
|
+
&.ab-button-6 {
|
|
198
|
+
right: 184px;
|
|
199
|
+
}
|
|
200
|
+
&.ab-button-select {
|
|
201
|
+
>* {
|
|
202
|
+
padding: 0 10px;
|
|
203
|
+
width: 24px;
|
|
204
|
+
height: 24px;
|
|
205
|
+
box-sizing: border-box;
|
|
206
|
+
}
|
|
207
|
+
>button {
|
|
208
|
+
padding: 0;
|
|
209
|
+
position: absolute;
|
|
210
|
+
pointer-events: none; // 点击穿透
|
|
211
|
+
z-index: 2;
|
|
212
|
+
text-align: center;
|
|
213
|
+
border: none;
|
|
214
|
+
box-shadow: none;
|
|
215
|
+
background: none;
|
|
216
|
+
}
|
|
217
|
+
>select {
|
|
218
|
+
z-index: 1;
|
|
219
|
+
opacity: 0; // select透明不影响option
|
|
220
|
+
}
|
|
221
|
+
option {
|
|
222
|
+
padding: 0 10px;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
img.cm-widgetBuffer{
|
|
228
|
+
height: 2px;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.ab-note {
|
|
233
|
+
// 修复重渲染问题
|
|
234
|
+
.markdown-rendered table { // 重渲染的表格宽度过宽的问题 (这里好像是Sp主题引起的)
|
|
235
|
+
min-width: 0;
|
|
236
|
+
}
|
|
237
|
+
.markdown-rendered ul li,
|
|
238
|
+
.markdown-rendered ol li { // 重渲染的列表间隔会变得特别高
|
|
239
|
+
margin-bottom: 0;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// 修复ob新版本导致表格宽度减少
|
|
243
|
+
table {
|
|
244
|
+
display: table;
|
|
245
|
+
width: 100%;
|
|
246
|
+
}
|
|
247
|
+
table[modeT="true"] { // 表格转置
|
|
248
|
+
tr { display: block; float: left; }
|
|
249
|
+
th, td { display: block; }
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// 未渲染前的mermaid
|
|
253
|
+
pre.ab-mermaid-raw {
|
|
254
|
+
border: solid 1px;
|
|
255
|
+
border-radius: 6px;
|
|
256
|
+
margin-top: 0;
|
|
257
|
+
}
|
|
258
|
+
// 未渲染前的markmap
|
|
259
|
+
.ab-markmap-svg {
|
|
260
|
+
border: solid 1px;
|
|
261
|
+
border-radius: 6px;
|
|
262
|
+
width: 100%;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// 标签栏
|
|
266
|
+
.ab-tab-root {
|
|
267
|
+
.ab-tab-nav {
|
|
268
|
+
// height: 40px;
|
|
269
|
+
box-sizing: border-box;
|
|
270
|
+
border: 2px solid var(--ab-tab-root-bd-color);
|
|
271
|
+
background-color: var(--ab-tab-root-bd-color);
|
|
272
|
+
color: var(--ab-tab-root-tx-color);
|
|
273
|
+
border-bottom: none;
|
|
274
|
+
border-radius: 10px 10px 0 0;
|
|
275
|
+
padding-right: 60px; // 这个是为了避免与编辑按钮重叠
|
|
276
|
+
.ab-tab-nav-item {
|
|
277
|
+
height: 38px; // 40-2
|
|
278
|
+
box-shadow: none;
|
|
279
|
+
border: none;
|
|
280
|
+
border-radius: 10px 10px 0 0;
|
|
281
|
+
padding-left: 20px;
|
|
282
|
+
padding-right: 20px;
|
|
283
|
+
font-size: 0.9em;
|
|
284
|
+
font-weight: bold;
|
|
285
|
+
cursor: pointer;
|
|
286
|
+
&[is_activate="false"] {
|
|
287
|
+
background-color: var(--ab-tab-root-bd-color);
|
|
288
|
+
color: var(--ab-tab-root-tx-color);
|
|
289
|
+
}
|
|
290
|
+
&[is_activate="true"] {
|
|
291
|
+
background-color: var(--ab-tab-root-bg-color);
|
|
292
|
+
color: var(--ab-tab-root-tx-color);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
.ab-tab-content {
|
|
297
|
+
border: 2px solid var(--ab-tab-root-bd-color);
|
|
298
|
+
background-color: var(--ab-tab-root-bg-color);
|
|
299
|
+
color: var(--ab-tab-root-tx-color);
|
|
300
|
+
border-top: none;
|
|
301
|
+
padding: 10px 20px;
|
|
302
|
+
.ab-tab-content-item {
|
|
303
|
+
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// 使单元格内容更紧凑 - 去除单元格内部的间隔 (首尾)
|
|
309
|
+
td>p:first-child, th>p:first-child, // ob x 8
|
|
310
|
+
td>ul:first-child, th>ul:first-child,
|
|
311
|
+
.ab-list-table-witharrow>p:first-child,
|
|
312
|
+
.ab-nodes-content>p:first-child,
|
|
313
|
+
.ab-items-item>div>p:first-child, .ab-items-item>div>ul:first-child,
|
|
314
|
+
td>div>p:first-child, th>div>p:first-child, // mdit x 8
|
|
315
|
+
td>div>ul:first-child, th>div>ul:first-child,
|
|
316
|
+
.ab-list-table-witharrow>div>p:first-child,
|
|
317
|
+
.ab-nodes-content>div>p:first-child,
|
|
318
|
+
.ab-items-item>div>div>p:first-child, .ab-items-item>div>div>ul:first-child
|
|
319
|
+
{
|
|
320
|
+
margin-top: 2px;
|
|
321
|
+
}
|
|
322
|
+
td>p:last-child, th>p:last-child, // ob x 8
|
|
323
|
+
td>ul:last-child, th>ul:last-child,
|
|
324
|
+
.ab-list-table-witharrow>p:last-child,
|
|
325
|
+
.ab-nodes-content>p:last-child,
|
|
326
|
+
.ab-items-item>div>p:last-child, .ab-items-item>div>ul:last-child,
|
|
327
|
+
td>div>p:last-child, th>div>p:last-child, // mdit x 8
|
|
328
|
+
td>div>ul:last-child, th>div>ul:last-child,
|
|
329
|
+
.ab-list-table-witharrow>div>p:last-child,
|
|
330
|
+
.ab-nodes-content>div>p:last-child,
|
|
331
|
+
.ab-items-item>div>div>p:last-child, .ab-items-item>div>div>ul:last-child
|
|
332
|
+
{
|
|
333
|
+
margin-bottom: 2px;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// 通用表格
|
|
337
|
+
table.ab-table {
|
|
338
|
+
// 使空格内容更紧凑 - 去除单元格之间的间距
|
|
339
|
+
border-collapse: collapse;
|
|
340
|
+
td,th{
|
|
341
|
+
white-space: normal;
|
|
342
|
+
overflow-wrap: break-word;
|
|
343
|
+
code {white-space: pre;}
|
|
344
|
+
padding: 2px 5px;
|
|
345
|
+
border: solid var(--ab-table-border-width) var(--ab-table-border-color);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// 取消自带的隔行表格着色
|
|
349
|
+
// tr:nth-child(2n+1)
|
|
350
|
+
tr {
|
|
351
|
+
background: none;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// 多叉表格
|
|
356
|
+
.ab-branch-table {
|
|
357
|
+
// 仿列表样式的普通表格 // TODO 第一列是选不好的,得js那边给 “真-第一列” 进行标记
|
|
358
|
+
&.ab-table-likelist {
|
|
359
|
+
td {
|
|
360
|
+
border: none;
|
|
361
|
+
padding-bottom: 10px;
|
|
362
|
+
vertical-align: top;
|
|
363
|
+
box-sizing: border-box;
|
|
364
|
+
}
|
|
365
|
+
// td { // :nth-child(2) {
|
|
366
|
+
// padding-left: 20px;
|
|
367
|
+
// position: relative;
|
|
368
|
+
// &::before {
|
|
369
|
+
// position: absolute;
|
|
370
|
+
// top: 14px;
|
|
371
|
+
// transform: translateY(-50%);
|
|
372
|
+
// width: 4px;
|
|
373
|
+
// height: 4px;
|
|
374
|
+
// border: solid 1px;
|
|
375
|
+
// left: 6px;
|
|
376
|
+
// content: '';
|
|
377
|
+
// border-radius: 50%;
|
|
378
|
+
// }
|
|
379
|
+
// }
|
|
380
|
+
// td:last-child {
|
|
381
|
+
// border: none;
|
|
382
|
+
// &::after {
|
|
383
|
+
// content: none;
|
|
384
|
+
// }
|
|
385
|
+
// }
|
|
386
|
+
td[col_index="0"] { // :first-child {
|
|
387
|
+
padding-right: 8px;
|
|
388
|
+
padding-left: 20px;
|
|
389
|
+
position: relative;
|
|
390
|
+
&::before {
|
|
391
|
+
position: absolute;
|
|
392
|
+
top: 14px;
|
|
393
|
+
transform: translateY(-50%);
|
|
394
|
+
width: 5px;
|
|
395
|
+
height: 5px;
|
|
396
|
+
border: none;
|
|
397
|
+
left: 6px;
|
|
398
|
+
|
|
399
|
+
content: '';
|
|
400
|
+
border-radius: 50%;
|
|
401
|
+
background-color: currentColor;
|
|
402
|
+
}
|
|
403
|
+
&::after {
|
|
404
|
+
content: "";
|
|
405
|
+
position: absolute;
|
|
406
|
+
top: 3px;
|
|
407
|
+
bottom: 5px;
|
|
408
|
+
right: 0;
|
|
409
|
+
//width: 1px;
|
|
410
|
+
//height: calc(100% - 6px);
|
|
411
|
+
border-right: 1px solid currentColor;
|
|
412
|
+
pointer-events: none;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// 列表格
|
|
419
|
+
table.ab-list-table{
|
|
420
|
+
// 通用
|
|
421
|
+
.ab-foldable-tr {
|
|
422
|
+
&>td:first-child{
|
|
423
|
+
>div{
|
|
424
|
+
padding-left: 15px;
|
|
425
|
+
position: relative;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
&[able_fold="true"]>td:first-child{
|
|
429
|
+
>div::before{
|
|
430
|
+
content: "";
|
|
431
|
+
position: absolute;
|
|
432
|
+
width: 0;
|
|
433
|
+
height: 0;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
&[able_fold="true"][is_fold="true"]>td:first-child{ // 箭头图标
|
|
437
|
+
>div:first-child::before{
|
|
438
|
+
top: 5px;
|
|
439
|
+
left: 2px;
|
|
440
|
+
border: 6px solid transparent;
|
|
441
|
+
border-left-color: currentColor;
|
|
442
|
+
cursor: pointer;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
&[able_fold="true"][is_fold="false"]>td:first-child{ // 箭头图标
|
|
446
|
+
>div:first-child::before{
|
|
447
|
+
top: 9px;
|
|
448
|
+
left: -1px;
|
|
449
|
+
border: 6px solid transparent;
|
|
450
|
+
border-top-color: currentColor;
|
|
451
|
+
cursor: pointer;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
// 缩进
|
|
455
|
+
&[tr_level="0"]>td:first-child{padding-left: calc(0*24px);}
|
|
456
|
+
&[tr_level="1"]>td:first-child{padding-left: calc(1*24px);}
|
|
457
|
+
&[tr_level="2"]>td:first-child{padding-left: calc(2*24px);}
|
|
458
|
+
&[tr_level="3"]>td:first-child{padding-left: calc(3*24px);}
|
|
459
|
+
&[tr_level="4"]>td:first-child{padding-left: calc(4*24px);}
|
|
460
|
+
&[tr_level="5"]>td:first-child{padding-left: calc(5*24px);}
|
|
461
|
+
&[tr_level="6"]>td:first-child{padding-left: calc(6*24px);}
|
|
462
|
+
&[tr_level="7"]>td:first-child{padding-left: calc(7*24px);}
|
|
463
|
+
&[tr_level="8"]>td:first-child{padding-left: calc(8*24px);}
|
|
464
|
+
&[tr_level="9"]>td:first-child{padding-left: calc(9*24px);}
|
|
465
|
+
&[tr_level="10"]>td:first-child{padding-left: calc(10*24px);}
|
|
466
|
+
&[tr_level="11"]>td:first-child{padding-left: calc(11*24px);}
|
|
467
|
+
&[tr_level="12"]>td:first-child{padding-left: calc(12*24px);}
|
|
468
|
+
&[tr_level="13"]>td:first-child{padding-left: calc(13*24px);}
|
|
469
|
+
&[tr_level="14"]>td:first-child{padding-left: calc(14*24px);}
|
|
470
|
+
&[tr_level="15"]>td:first-child{padding-left: calc(15*24px);}
|
|
471
|
+
&[tr_level="16"]>td:first-child{padding-left: calc(16*24px);}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
// 仿列表样式的列表格
|
|
475
|
+
&.ab-listtable-likelist {
|
|
476
|
+
margin-left: 24px;
|
|
477
|
+
td {
|
|
478
|
+
border: none;
|
|
479
|
+
vertical-align: top;
|
|
480
|
+
}
|
|
481
|
+
// 覆盖列表格的部分样式
|
|
482
|
+
.ab-foldable-tr>td:first-child>div.ab-list-table-witharrow {
|
|
483
|
+
padding: 0 !important;
|
|
484
|
+
padding-right: 8px;
|
|
485
|
+
padding-left: 20px;
|
|
486
|
+
position: relative;
|
|
487
|
+
display: inline-block;
|
|
488
|
+
&::before {
|
|
489
|
+
border: solid 1px !important;
|
|
490
|
+
background: none !important;
|
|
491
|
+
width: 6px !important;
|
|
492
|
+
height: 6px !important;
|
|
493
|
+
|
|
494
|
+
box-sizing: border-box;
|
|
495
|
+
position: absolute;
|
|
496
|
+
top: 12px !important;
|
|
497
|
+
transform: translateY(-50%) !important;
|
|
498
|
+
left: -14px !important;
|
|
499
|
+
content: '';
|
|
500
|
+
border-radius: 50%;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
.ab-foldable-tr[tr_level="0"]>td:first-child>div.ab-list-table-witharrow {
|
|
504
|
+
&::before {
|
|
505
|
+
border: 0 !important;
|
|
506
|
+
background-color: currentColor !important;
|
|
507
|
+
width: 6px !important;
|
|
508
|
+
height: 6px !important;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// 仿目录结构的列表格
|
|
514
|
+
&.ab-table-folder .ab-foldable-tr{
|
|
515
|
+
td:first-child {
|
|
516
|
+
white-space: pre;
|
|
517
|
+
vertical-align: top;
|
|
518
|
+
}
|
|
519
|
+
&>td>div {
|
|
520
|
+
// float: left; (这个没办法让div下的div2和div3在同一行,用inline-block代替之)
|
|
521
|
+
display: inline-block;
|
|
522
|
+
vertical-align: top;
|
|
523
|
+
&.ab-list-table-witharrow {
|
|
524
|
+
padding-left: 6px; // old 15
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
.ab-list-table-svg {
|
|
528
|
+
padding-top: 4px;
|
|
529
|
+
svg{
|
|
530
|
+
width: 13px;
|
|
531
|
+
height: 16px;
|
|
532
|
+
fill: var(--ab-bright-color);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
// 边框处理
|
|
536
|
+
td:first-child {
|
|
537
|
+
border: none;
|
|
538
|
+
}
|
|
539
|
+
td {
|
|
540
|
+
border-left: none;
|
|
541
|
+
border-right: none;
|
|
542
|
+
border-bottom: none;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
// 列表格 - 总折叠按钮
|
|
547
|
+
.ab-list-table-parent {
|
|
548
|
+
position: relative;
|
|
549
|
+
.ab-table-fold {
|
|
550
|
+
position: absolute;
|
|
551
|
+
bottom: 0;
|
|
552
|
+
right: 0;
|
|
553
|
+
|
|
554
|
+
background: none;
|
|
555
|
+
border: none;
|
|
556
|
+
color: currentColor;
|
|
557
|
+
cursor: pointer;
|
|
558
|
+
padding: 2px 6px;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// 时间线表格
|
|
563
|
+
table.ab-table-timeline {
|
|
564
|
+
td {
|
|
565
|
+
border-right: none;
|
|
566
|
+
padding-left: 20px;
|
|
567
|
+
}
|
|
568
|
+
td[col_index="0"] {
|
|
569
|
+
border: none;
|
|
570
|
+
border-left: none;
|
|
571
|
+
border-right: solid 2px;
|
|
572
|
+
padding-left: 5px;
|
|
573
|
+
padding-right: 20px;
|
|
574
|
+
color: var(--ab-bright-color);
|
|
575
|
+
|
|
576
|
+
position: relative;
|
|
577
|
+
overflow: visible;
|
|
578
|
+
&::after {
|
|
579
|
+
position: absolute;
|
|
580
|
+
top: 1em;
|
|
581
|
+
transform: translateY(-50%);
|
|
582
|
+
width: 10px;
|
|
583
|
+
height: 10px;
|
|
584
|
+
right: -8px;
|
|
585
|
+
|
|
586
|
+
content: '';
|
|
587
|
+
background-color: var(--ab-bright-color);
|
|
588
|
+
border-radius: 50%;
|
|
589
|
+
border: solid 2px;
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
// td:nth-child(2) {
|
|
593
|
+
// padding-left: 20px;
|
|
594
|
+
// }
|
|
595
|
+
// td:last-child {
|
|
596
|
+
// border-right: none;
|
|
597
|
+
// }
|
|
598
|
+
tr:first-child td {
|
|
599
|
+
border-top: none;
|
|
600
|
+
}
|
|
601
|
+
tr:last-child td {
|
|
602
|
+
border-bottom: none;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// FAQ
|
|
607
|
+
.markdown-rendered.ab-faq-content{
|
|
608
|
+
p:first-child {margin-top: 0;}
|
|
609
|
+
p:last-child {margin-bottom: 0;}
|
|
610
|
+
}
|
|
611
|
+
.ab-faq{
|
|
612
|
+
.ab-faq-line{
|
|
613
|
+
line-height: 30px;
|
|
614
|
+
width: 100%;
|
|
615
|
+
padding: 0 15px 0 15px;
|
|
616
|
+
clear: both;
|
|
617
|
+
overflow-y: auto;
|
|
618
|
+
|
|
619
|
+
.ab-faq-bubble {
|
|
620
|
+
float: left;
|
|
621
|
+
width: calc(100% - 75px);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
.ab-faq-line.ab-faq-q,
|
|
625
|
+
.ab-faq-line.ab-faq-Q{
|
|
626
|
+
background-color: #1e53ee;
|
|
627
|
+
border-radius: 12px 12px 0 0;
|
|
628
|
+
}
|
|
629
|
+
.ab-faq-line.ab-faq-a,
|
|
630
|
+
.ab-faq-line.ab-faq-A{
|
|
631
|
+
background-color: #f5f8fe;
|
|
632
|
+
border-radius: 0 0 12px 12px;
|
|
633
|
+
color: #a994a6;
|
|
634
|
+
margin-bottom: 20px;
|
|
635
|
+
}
|
|
636
|
+
.ab-faq-line::before{
|
|
637
|
+
float: left;
|
|
638
|
+
width: 24px;
|
|
639
|
+
}
|
|
640
|
+
.ab-faq-line.ab-faq-q::before,
|
|
641
|
+
.ab-faq-line.ab-faq-Q::before{
|
|
642
|
+
content: "Q";
|
|
643
|
+
}
|
|
644
|
+
.ab-faq-line.ab-faq-a::before,
|
|
645
|
+
.ab-faq-line.ab-faq-A::before{
|
|
646
|
+
content: "A";
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
// 折叠
|
|
651
|
+
.ab-deco-fold{
|
|
652
|
+
.ab-deco-fold-button{
|
|
653
|
+
color: var(--ab-bright-color);
|
|
654
|
+
border-bottom: 1px solid var(--ab-bright-color);
|
|
655
|
+
height: 30px;
|
|
656
|
+
line-height: 30px;
|
|
657
|
+
padding-left: 6px;
|
|
658
|
+
// border-radius: 5px;
|
|
659
|
+
width: 100%;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
// 滚动
|
|
664
|
+
.ab-deco-scroll.ab-deco-scroll-y {
|
|
665
|
+
overflow-y:auto;
|
|
666
|
+
}
|
|
667
|
+
.ab-deco-scroll.ab-deco-scroll-x {
|
|
668
|
+
overflow-x:auto;
|
|
669
|
+
white-space: pre !important;
|
|
670
|
+
th, td {
|
|
671
|
+
white-space: pre !important;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
// 超出折叠
|
|
676
|
+
.ab-deco-overfold{
|
|
677
|
+
overflow-y: hidden;
|
|
678
|
+
position: relative;
|
|
679
|
+
.ab-deco-overfold-button{
|
|
680
|
+
position: absolute;
|
|
681
|
+
bottom: 0;
|
|
682
|
+
height: 40px;
|
|
683
|
+
line-height: 40px;
|
|
684
|
+
width: 100%;
|
|
685
|
+
text-align: center;
|
|
686
|
+
box-sizing: content-box;
|
|
687
|
+
}
|
|
688
|
+
.ab-deco-overfold-content{
|
|
689
|
+
margin-bottom: 40px;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
.ab-deco-overfold[is-fold="true"]{
|
|
693
|
+
.ab-deco-overfold-button{
|
|
694
|
+
padding-top: 60px;
|
|
695
|
+
background-image: linear-gradient(-180deg, rgba(24, 26, 27, 0) 0%, rgb(24, 26, 27) 100%)
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
// 黑幕
|
|
700
|
+
.ab-deco-heimu, .ab-deco-heimu a{
|
|
701
|
+
background-color: #252525;
|
|
702
|
+
color:#252525;
|
|
703
|
+
text-shadow: none;
|
|
704
|
+
&::selection{
|
|
705
|
+
background:#9ab0c0;
|
|
706
|
+
color:#fff;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
.ab-deco-heimu:hover, .ab-deco-heimu:hover a{
|
|
710
|
+
transition:color .13s linear;
|
|
711
|
+
color:#fff;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
// 标题 // TODO 在ob阅读模式下间距不正常
|
|
715
|
+
.ab-deco-title{
|
|
716
|
+
width: 100%;
|
|
717
|
+
p{
|
|
718
|
+
font-size: 17px;
|
|
719
|
+
line-height: 17px;
|
|
720
|
+
margin: 0;
|
|
721
|
+
margin-bottom: 10px;
|
|
722
|
+
}
|
|
723
|
+
pre {
|
|
724
|
+
margin: 0;
|
|
725
|
+
}
|
|
726
|
+
.ab-deco-title-title{
|
|
727
|
+
height: auto;
|
|
728
|
+
}
|
|
729
|
+
.ab-deco-title-title[title-type="table"]>p{
|
|
730
|
+
font-weight: bold;
|
|
731
|
+
text-align: center;
|
|
732
|
+
margin-top: 10px;
|
|
733
|
+
margin-bottom: 16px;
|
|
734
|
+
}
|
|
735
|
+
.ab-deco-title-title[title-type="pre"]>p{
|
|
736
|
+
display: inline;
|
|
737
|
+
font-size: 16px;
|
|
738
|
+
font-weight: 400;
|
|
739
|
+
background-color: var(--pre-background-color);
|
|
740
|
+
padding: 8px 16px 11px 16px;
|
|
741
|
+
border-radius: 8px 8px 0 0;
|
|
742
|
+
margin: 0;
|
|
743
|
+
}
|
|
744
|
+
.ab-deco-title-title[title-type="quote"]>p{
|
|
745
|
+
font-weight: bold;
|
|
746
|
+
margin-bottom: 20px;
|
|
747
|
+
}
|
|
748
|
+
.ab-deco-title-title[title-type="ul"]>p{
|
|
749
|
+
font-weight: bold;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
// 快捷的二层容器 container
|
|
754
|
+
.ab-items {
|
|
755
|
+
white-space: normal;
|
|
756
|
+
overflow-wrap: break-word;
|
|
757
|
+
code {white-space: pre;}
|
|
758
|
+
|
|
759
|
+
// 分栏
|
|
760
|
+
&.ab-col{
|
|
761
|
+
display: flex; // Flexbox 布局
|
|
762
|
+
flex-wrap: wrap; // 元素换行显示
|
|
763
|
+
gap: 0rem; // 间隙
|
|
764
|
+
.ab-items-item {
|
|
765
|
+
flex: 1 0 calc(33.33% - 1rem); // 每个项目的宽度大约为容器的 33.33%,减去间隙的一半
|
|
766
|
+
box-sizing: border-box; // 确保 padding 和 border 不影响元素的实际大小
|
|
767
|
+
padding: 10px;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
// 卡片
|
|
772
|
+
&.ab-card {
|
|
773
|
+
// 布局无关部分
|
|
774
|
+
.ab-items-item {
|
|
775
|
+
box-sizing: border-box; // 确保 padding 和 border 不影响元素的实际大小
|
|
776
|
+
color: var(--ab-tab-root-tx-color);
|
|
777
|
+
background-color: var(--ab-tab-root-bg-color);
|
|
778
|
+
border: solid 2px var(--ab-tab-root-bd-color);
|
|
779
|
+
border-radius: 6px;
|
|
780
|
+
box-shadow: #34343f;
|
|
781
|
+
margin-bottom: 10px;
|
|
782
|
+
padding: 5px 10px;
|
|
783
|
+
|
|
784
|
+
&>div {
|
|
785
|
+
padding-top: 2px;
|
|
786
|
+
padding-bottom: 2px;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
.ab-items-title {
|
|
790
|
+
// color: var(--ab-bright-color);
|
|
791
|
+
border-bottom: 1px solid var(--ab-bright-color);
|
|
792
|
+
}
|
|
793
|
+
.ab-items-content {
|
|
794
|
+
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
// 布局1,纵向瀑布流 (有js)
|
|
799
|
+
&.ab-lay-vfall:not(.ab-hfall) {
|
|
800
|
+
// 方式一,对齐, flex布局
|
|
801
|
+
/*display: flex; // Flexbox 布局
|
|
802
|
+
flex-wrap: wrap; // 元素换行显示
|
|
803
|
+
gap: 1rem; // 间隙
|
|
804
|
+
.ab-items-item {
|
|
805
|
+
flex: 1 0 calc(25% - 1rem); // 每个项目的宽度大约为容器的 33.33%,减去间隙的一半
|
|
806
|
+
}*/
|
|
807
|
+
|
|
808
|
+
// 方式二,瀑布流, column-count方式
|
|
809
|
+
// 列数。其中ob默认700px宽,我定义的小宽度是800,大宽度是1100。假设一列加边框200px较好
|
|
810
|
+
column-count: 4; // css不支持查询ab.card的宽度,只能查屏幕,这个得让js来
|
|
811
|
+
// @media (max-width: 1400px) { column-count: 6; }
|
|
812
|
+
// @media (max-width: 1200px) { column-count: 5; }
|
|
813
|
+
// @media (max-width: 1000px) { column-count: 4; }
|
|
814
|
+
// @media (max-width: 800px) { column-count: 3; }
|
|
815
|
+
// @media (max-width: 600px) { column-count: 2; }
|
|
816
|
+
// @media (max-width: 400px) { column-count: 1; }
|
|
817
|
+
column-gap: 10px; // 列间距
|
|
818
|
+
.ab-items-item {
|
|
819
|
+
break-inside: avoid-column; // 防止单个元素被拆分到多列
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
// 方式三,瀑布流, grid网格顺序,但兼容性有问题
|
|
823
|
+
/*display: grid;
|
|
824
|
+
grid-template-columns: repeat(4, 1fr);
|
|
825
|
+
grid-gap: 1rem; // 间隙
|
|
826
|
+
grid-template-rows: masonry; // 兼容有问题,只有火狐支持,还tm的要开选项
|
|
827
|
+
.ab-items-item {
|
|
828
|
+
width: 100%;
|
|
829
|
+
display: block;
|
|
830
|
+
}*/
|
|
831
|
+
|
|
832
|
+
// 方式四,瀑布流, flex布局,一定程度的排序 (非绝对),但需要给一个合适的高度
|
|
833
|
+
/*display: flex; // Flexbox 布局
|
|
834
|
+
flex-wrap: wrap; // 元素换行显示
|
|
835
|
+
// gap: 1rem; // 间隙
|
|
836
|
+
flex-direction: column; // 按列填充
|
|
837
|
+
.ab-items-item {
|
|
838
|
+
position: relative;
|
|
839
|
+
width: calc(100% / 4);
|
|
840
|
+
padding: 5px;
|
|
841
|
+
box-sizing: border-box;
|
|
842
|
+
&:nth-child(4n+1){ order: 1; }
|
|
843
|
+
&:nth-child(4n+2){ order: 2; }
|
|
844
|
+
&:nth-child(4n+3){ order: 3; }
|
|
845
|
+
&:nth-child(4n+0){ order: 4; }
|
|
846
|
+
}*/
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
// 布局2,横向瀑布流
|
|
850
|
+
&.ab-lay-hfall {
|
|
851
|
+
// 布局无关
|
|
852
|
+
.ab-items-item .ab-items-title {
|
|
853
|
+
color: currentColor;
|
|
854
|
+
border-bottom: none;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
// flex方案 (但是文字会把卡片撑到100%,仅图片并且最好是做成background的形式,那就不错)
|
|
858
|
+
display: flex;
|
|
859
|
+
flex-wrap: wrap;
|
|
860
|
+
flex-direction: row;
|
|
861
|
+
&::after { // 如果最后一行不够填满整行,则使用这个
|
|
862
|
+
content: "";
|
|
863
|
+
flex-grow: 99999;
|
|
864
|
+
}
|
|
865
|
+
>.ab-items-item {
|
|
866
|
+
flex-grow: 1;
|
|
867
|
+
margin: 5px;
|
|
868
|
+
padding: 0 10px;
|
|
869
|
+
position: relative;
|
|
870
|
+
overflow: hidden;
|
|
871
|
+
// 限制图片高度
|
|
872
|
+
img {
|
|
873
|
+
max-width: 100%;
|
|
874
|
+
min-width: 100%;
|
|
875
|
+
height: 200px;
|
|
876
|
+
margin: 0; // 这种布局下,默认认为最多只有一张图片,且该图片在title的位置
|
|
877
|
+
object-fit: cover; // 被裁减
|
|
878
|
+
vertical-align: bottom;
|
|
879
|
+
}
|
|
880
|
+
// 限制文字宽度 (否则文字稍长会导致一个卡片占一行)
|
|
881
|
+
p {
|
|
882
|
+
max-width: 300px;
|
|
883
|
+
margin: 0; // 这种布局下,默认认为最多只有一行文字
|
|
884
|
+
}
|
|
885
|
+
&>.ab-items-content {
|
|
886
|
+
height: 100%;
|
|
887
|
+
min-width: 100%;
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
// 布局3,网格整齐排列 (内容特别整齐时可用) (此处代码有点乱)
|
|
893
|
+
&.ab-lay-grid {
|
|
894
|
+
display: grid;
|
|
895
|
+
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
|
896
|
+
// grid-auto-flow: column;
|
|
897
|
+
gap: 0px !important;
|
|
898
|
+
margin: 0 auto;
|
|
899
|
+
&::after {
|
|
900
|
+
content: "";
|
|
901
|
+
flex-grow: 99999;
|
|
902
|
+
}
|
|
903
|
+
>.ab-items-item {
|
|
904
|
+
position: relative;
|
|
905
|
+
margin: 5px;
|
|
906
|
+
display: flex;
|
|
907
|
+
flex-direction: column;
|
|
908
|
+
align-items: center;
|
|
909
|
+
text-align: center; /* 确保文字居中 */
|
|
910
|
+
|
|
911
|
+
img {
|
|
912
|
+
max-width: 200px;
|
|
913
|
+
max-height: 200px;
|
|
914
|
+
width: 100%; /* 确保图片宽度为100%,适应网格布局 */
|
|
915
|
+
height: auto;
|
|
916
|
+
margin: 0;
|
|
917
|
+
}
|
|
918
|
+
&>.ab-items-content {
|
|
919
|
+
width: 100%;
|
|
920
|
+
padding: 0;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
// 布局4,横向滚动 (非循环)
|
|
926
|
+
&.ab-deco-scroll-x {
|
|
927
|
+
margin: 0 auto;
|
|
928
|
+
display: flex;
|
|
929
|
+
flex-wrap: nowrap;
|
|
930
|
+
overflow-x: auto;
|
|
931
|
+
.ab-items-item {
|
|
932
|
+
flex: 0 0 auto;
|
|
933
|
+
width: 170px;
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
> .ab-items-item { overflow-x: auto; }
|
|
939
|
+
|
|
940
|
+
// 补充结合样式
|
|
941
|
+
// 默认 & { column-count: 4 !important; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr) !important; }
|
|
942
|
+
&.ab-col1 { column-count: 1 !important; grid-template-columns: repeat(1, 1fr) !important; }
|
|
943
|
+
&.ab-col2 { column-count: 2 !important; grid-template-columns: repeat(2, 1fr) !important; }
|
|
944
|
+
&.ab-col3 { column-count: 3 !important; grid-template-columns: repeat(3, 1fr) !important; }
|
|
945
|
+
&.ab-col4 { column-count: 4 !important; grid-template-columns: repeat(4, 1fr) !important; }
|
|
946
|
+
&.ab-col5 { column-count: 5 !important; grid-template-columns: repeat(5, 1fr) !important; }
|
|
947
|
+
&.ab-col6 { column-count: 6 !important; grid-template-columns: repeat(6, 1fr) !important; }
|
|
948
|
+
&.ab-col7 { column-count: 7 !important; grid-template-columns: repeat(7, 1fr) !important; }
|
|
949
|
+
&.ab-col8 { column-count: 8 !important; grid-template-columns: repeat(8, 1fr) !important; }
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
// 节点图、括弧图、ab思维导图
|
|
953
|
+
.ab-nodes {
|
|
954
|
+
white-space: normal;
|
|
955
|
+
overflow-wrap: break-word;
|
|
956
|
+
code {white-space: pre;}
|
|
957
|
+
// display: flex;
|
|
958
|
+
// flex-direction: column;
|
|
959
|
+
// align-items: flex-start;
|
|
960
|
+
// gap: 1em; // 根的上下间距
|
|
961
|
+
|
|
962
|
+
// 圆弧节点,最左侧必是
|
|
963
|
+
.ab-nodes-content {
|
|
964
|
+
display: inline-block;
|
|
965
|
+
background-color: rgba(100,100,100,0.25);
|
|
966
|
+
padding: 2px 10px;
|
|
967
|
+
margin-left: 5px;
|
|
968
|
+
}
|
|
969
|
+
// 圆弧节点组,最右测必是
|
|
970
|
+
.ab-nodes-children {
|
|
971
|
+
display: flex;
|
|
972
|
+
flex-direction: column;
|
|
973
|
+
// align-items
|
|
974
|
+
gap: 16px; // 上下间距,旧1.2em/20px
|
|
975
|
+
|
|
976
|
+
// border-left: 2px solid currentColor; // black;
|
|
977
|
+
padding-left: 0.8em;
|
|
978
|
+
position: relative; // 作为定位容器
|
|
979
|
+
// 圆弧样式 - 中间箭头
|
|
980
|
+
.ab-nodes-bracket {
|
|
981
|
+
content: "";
|
|
982
|
+
box-sizing: border-box;
|
|
983
|
+
position: absolute;
|
|
984
|
+
width: 8px;
|
|
985
|
+
height: 8px;
|
|
986
|
+
top: calc(50% - 4px);
|
|
987
|
+
left: calc(-8px + 2px); // 重合一个px避免出现黑线
|
|
988
|
+
clip-path: polygon(100% 0, 100% 100%, 13.40% 50%); // 裁剪成等边三角形
|
|
989
|
+
background-color: currentColor;
|
|
990
|
+
}
|
|
991
|
+
// 圆弧样式 - 两头弯曲
|
|
992
|
+
.ab-nodes-bracket2 {
|
|
993
|
+
content: "";
|
|
994
|
+
box-sizing: border-box;
|
|
995
|
+
position: absolute;
|
|
996
|
+
width: 10px;
|
|
997
|
+
height: calc(100% - 8px); // JS: 缩短第一个和最后一个节点的一半
|
|
998
|
+
top: 4px; // JS: 第一个节点的一半
|
|
999
|
+
left: 0;
|
|
1000
|
+
border-radius: 10px 0 0 10px;
|
|
1001
|
+
border-left: 2px solid currentColor;
|
|
1002
|
+
border-top: 2px solid currentColor;
|
|
1003
|
+
border-bottom: 2px solid currentColor;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
// 节点内容
|
|
1007
|
+
.ab-nodes-node {
|
|
1008
|
+
display: flex;
|
|
1009
|
+
flex-direction: row;
|
|
1010
|
+
align-items: center;
|
|
1011
|
+
gap: 1.2em; // 左右间隙
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
// 最左侧节点处理,不显示
|
|
1015
|
+
&>.ab-nodes-node>.ab-nodes-bracket { display: none; }
|
|
1016
|
+
&>.ab-nodes-node>.ab-nodes-bracket2 { display: none; }
|
|
1017
|
+
// 最右侧节点处理
|
|
1018
|
+
.ab-nodes-node[has_children="false"] {
|
|
1019
|
+
&>.ab-nodes-children {
|
|
1020
|
+
display: none;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
// min版的node图
|
|
1026
|
+
.ab-nodes.min {
|
|
1027
|
+
.ab-nodes-content {
|
|
1028
|
+
padding: 0;
|
|
1029
|
+
background: none;
|
|
1030
|
+
border-bottom: solid 1px currentColor;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
.ab-nodes-children {
|
|
1034
|
+
gap: 2px;
|
|
1035
|
+
|
|
1036
|
+
.ab-nodes-bracket2 {
|
|
1037
|
+
border-width: 1px;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
.ab-nodes-bracket {
|
|
1041
|
+
display: none;
|
|
1042
|
+
width: 6px;
|
|
1043
|
+
height: 6px;
|
|
1044
|
+
top: calc(50% - 4px);
|
|
1045
|
+
left: calc(-8px + 2px)
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
// 间隔换padding,方便 “接线”
|
|
1050
|
+
.ab-nodes-content {
|
|
1051
|
+
padding-right: 1.2em;
|
|
1052
|
+
}
|
|
1053
|
+
.ab-nodes-children {
|
|
1054
|
+
.ab-nodes-node {
|
|
1055
|
+
gap: 0;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
// 最右侧节点处理
|
|
1060
|
+
.ab-nodes-node[has_children="false"] {
|
|
1061
|
+
&>.ab-nodes-content {
|
|
1062
|
+
padding-right: 4px;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
// 颜色
|
|
1066
|
+
.ab-nodes.min>.ab-nodes-children {
|
|
1067
|
+
&>.ab-nodes-node:nth-child(8n+1) { --node-color: var(--color-red); }
|
|
1068
|
+
&>.ab-nodes-node:nth-child(8n+2) { --node-color: var(--color-orange); }
|
|
1069
|
+
&>.ab-nodes-node:nth-child(8n+3) { --node-color: var(--color-yellow); }
|
|
1070
|
+
&>.ab-nodes-node:nth-child(8n+4) { --node-color: var(--color-green); }
|
|
1071
|
+
&>.ab-nodes-node:nth-child(8n+5) { --node-color: var(--color-cyan); }
|
|
1072
|
+
&>.ab-nodes-node:nth-child(8n+6) { --node-color: var(--color-blue); }
|
|
1073
|
+
&>.ab-nodes-node:nth-child(8n+7) { --node-color: var(--color-purple); }
|
|
1074
|
+
&>.ab-nodes-node:nth-child(8n+0) { --node-color: var(--color-pink); }
|
|
1075
|
+
|
|
1076
|
+
&>.ab-nodes-node .ab-nodes-content,
|
|
1077
|
+
&>.ab-nodes-node .ab-nodes-bracket,
|
|
1078
|
+
&>.ab-nodes-node .ab-nodes-bracket2 {
|
|
1079
|
+
border-color: var(--node-color);
|
|
1080
|
+
}
|
|
1081
|
+
&>.ab-nodes-node .ab-nodes-bracket {
|
|
1082
|
+
background-color: var(--node-color);
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
// scroll版的node图
|
|
1087
|
+
.ab-nodes.scroll {
|
|
1088
|
+
// 使整个块的宽度能够溢出,而不是文字被挤压换行
|
|
1089
|
+
overflow-x: auto;
|
|
1090
|
+
// 使单个项宽度不多于300px
|
|
1091
|
+
.ab-nodes-content {
|
|
1092
|
+
white-space: nowrap;
|
|
1093
|
+
max-width: 300px;
|
|
1094
|
+
overflow-x: auto;
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
// scroll版的table
|
|
1099
|
+
table.scroll {
|
|
1100
|
+
// 使整个块的宽度能够溢出,而不是文字被挤压换行
|
|
1101
|
+
overflow-x: auto;
|
|
1102
|
+
// 使单个项宽度不多于300px
|
|
1103
|
+
td {
|
|
1104
|
+
white-space: nowrap;
|
|
1105
|
+
max-width: 300px;
|
|
1106
|
+
overflow-x: auto;
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
// 设置面板中表格的滚动条翻转
|
|
1112
|
+
div.md-table-fig1{
|
|
1113
|
+
overflow-x:scroll;
|
|
1114
|
+
transform:scaleY(-1);
|
|
1115
|
+
table.ab-setting.md-table-fig2{
|
|
1116
|
+
overflow-x:scroll;
|
|
1117
|
+
text-overflow: clip !important;
|
|
1118
|
+
transform:scaleY(-1);
|
|
1119
|
+
// white-space: nowrap;
|
|
1120
|
+
white-space: pre-wrap;
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
// 自定义样式
|
|
1125
|
+
.ab-custom-text-red {color: red !important;}
|
|
1126
|
+
.ab-custom-text-orange {color: orange !important;}
|
|
1127
|
+
.ab-custom-text-yellow {color: yellow !important;}
|
|
1128
|
+
.ab-custom-text-green {color: green !important;}
|
|
1129
|
+
.ab-custom-text-cyan {color: cyan !important;}
|
|
1130
|
+
.ab-custom-text-blue {color: blue !important;}
|
|
1131
|
+
.ab-custom-text-purple {color: purple !important;}
|
|
1132
|
+
.ab-custom-text-white {color: white !important;}
|
|
1133
|
+
.ab-custom-text-black {color: black !important;}
|
|
1134
|
+
.ab-custom-bg-red {background-color: red !important;}
|
|
1135
|
+
.ab-custom-bg-orange {background-color: orange !important;}
|
|
1136
|
+
.ab-custom-bg-yellow {background-color: yellow !important;}
|
|
1137
|
+
.ab-custom-bg-green {background-color: green !important;}
|
|
1138
|
+
.ab-custom-bg-cyan {background-color: cyan !important;}
|
|
1139
|
+
.ab-custom-bg-blue {background-color: blue !important;}
|
|
1140
|
+
.ab-custom-bg-purple {background-color: purple !important;}
|
|
1141
|
+
.ab-custom-bg-white {background-color: white !important;}
|
|
1142
|
+
.ab-custom-bg-black {background-color: black !important;}
|
|
1143
|
+
.ab-custom-dire-top * {vertical-align: top !important;}
|
|
1144
|
+
.ab-custom-dire-down * {vertical-align: bottom !important;}
|
|
1145
|
+
.ab-custom-dire-left * {text-align: left !important;}
|
|
1146
|
+
.ab-custom-dire-right * {text-align: right !important;}
|
|
1147
|
+
.ab-custom-dire-center * {vertical-align: middle !important; text-align: center !important;}
|
|
1148
|
+
.ab-custom-dire-hcenter * {text-align: center !important;}
|
|
1149
|
+
.ab-custom-dire-vcenter * {vertical-align: middle !important;}
|
|
1150
|
+
.ab-custom-dire-justify * {text-align: justify !important;}
|
|
1151
|
+
.ab-custom-font-large {font-size: large !important;}
|
|
1152
|
+
.ab-custom-font-largex {font-size: x-large !important;}
|
|
1153
|
+
.ab-custom-font-largexx {font-size: xx-large !important;}
|
|
1154
|
+
.ab-custom-font-small {font-size: small !important;}
|
|
1155
|
+
.ab-custom-font-smallx {font-size: x-small !important;}
|
|
1156
|
+
.ab-custom-font-smallxx {font-size: xx-small !important;}
|
|
1157
|
+
.ab-custom-font-bold {font-weight: bold !important;}
|
|
1158
|
+
// 首列重点表格
|
|
1159
|
+
table.ab-table-fc {
|
|
1160
|
+
th[col_index="0"], td[col_index="0"] {
|
|
1161
|
+
white-space: pre;
|
|
1162
|
+
font-weight: 500;
|
|
1163
|
+
vertical-align: top;
|
|
1164
|
+
width: 0px;
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
.ab-table-fc>table {
|
|
1168
|
+
th:first-child, td:first-child {
|
|
1169
|
+
white-space: pre;
|
|
1170
|
+
font-weight: 500;
|
|
1171
|
+
vertical-align: top;
|
|
1172
|
+
width: 0px;
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
.ab-custom-td-nowrap td, .ab-custom-td1-nowrap tr>td:first-child {white-space: pre !important;}
|
|
1176
|
+
.ab-custom-td-wrap td, .ab-custom-td1-wrap tr>td:first-child {white-space: normal !important; overflow-wrap: break-word;}
|
|
1177
|
+
.ab-custom-td-0 td, .ab-custom-td1-0 tr>td:first-child {width: 0px !important;}
|
|
1178
|
+
.ab-custom-td-100 td, .ab-custom-td1-100 tr>td:first-child {width: 100px !important;}
|
|
1179
|
+
.ab-custom-td-150 td, .ab-custom-td1-150 tr>td:first-child {width: 150px !important;}
|
|
1180
|
+
.ab-custom-td-200 td, .ab-custom-td1-200 tr>td:first-child {width: 200px !important;}
|
|
1181
|
+
.ab-custom-td-250 td, .ab-custom-td1-250 tr>td:first-child {width: 250px !important;}
|
|
1182
|
+
.ab-custom-td-300 td, .ab-custom-td1-300 tr>td:first-child {width: 300px !important;}
|
|
1183
|
+
.ab-custom-td-half td, .ab-custom-td1-half tr>td:first-child {width: 50% !important;}
|
|
1184
|
+
|
|
1185
|
+
// js特殊class
|
|
1186
|
+
// .el-table { // 在阅读模式下异常
|
|
1187
|
+
// overflow-x: visible;
|
|
1188
|
+
// }
|
|
1189
|
+
// .ab-super-width {
|
|
1190
|
+
// width: var(--ab-width-outer);
|
|
1191
|
+
// margin-left: calc((100% - var(--ab-width-outer)) / 2);
|
|
1192
|
+
// }
|
|
1193
|
+
.ab-super-width-p { // 指定ab-super-width后的延伸物,不可直接指定
|
|
1194
|
+
width: var(--ab-width-outer);
|
|
1195
|
+
margin-left: calc((100% - var(--ab-width-outer)) / 2);
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
/**************** CM Style *******************/
|
|
1199
|
+
|
|
1200
|
+
.ab-line-brace {
|
|
1201
|
+
text-decoration: underline 1px red;
|
|
1202
|
+
}
|
|
1203
|
+
.ab-line-list {
|
|
1204
|
+
text-decoration: underline 1px cyan;
|
|
1205
|
+
}
|
|
1206
|
+
.ab-line-yellow {
|
|
1207
|
+
text-decoration: solid underline 1px rgba(0, 255, 0, 0.2);
|
|
1208
|
+
// border-left: solid 1px rgba(0, 255, 0, 0.4); // 这种方式对于 `:::` 是对的,但对其他来说,段落不一定是行开头。可能导致一行有多个左边框
|
|
1209
|
+
}
|
|
1210
|
+
.ab-line-blue {
|
|
1211
|
+
text-decoration: underline 1px blue;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
.bright-color {
|
|
1215
|
+
color: var(--ab-bright-color); // border-color:#9999ff
|
|
1216
|
+
border-color: var(--ab-bright-color);
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
/**************** 兼容性补充 ******************/
|
|
1220
|
+
|
|
1221
|
+
// markmap 需要这个样式,否则公式渲染会存在问题 (原内容没隐藏,且宽度过大)
|
|
1222
|
+
.markmap-foreign [aria-hidden="true"] { // .katex-html
|
|
1223
|
+
display: none;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
// BT主题在阅读模式下会干扰表格高度 (不确定有无其他误影响)
|
|
1227
|
+
:is(.markdown-preview-view,.markdown-rendered).is-readable-line-width:not(.matrix) .ab-note :is(.markdown-rendered) {
|
|
1228
|
+
width: auto !important;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
/**************** PRO *************************/
|
|
1232
|
+
|
|
1233
|
+
table td, table th {
|
|
1234
|
+
div>p:first-child, div>ul:first-child { margin-top: 2px; }
|
|
1235
|
+
div>p:last-child, div>ul:last-child { margin-bottom: 2px; }
|
|
1236
|
+
}
|
|
1237
|
+
// .markdown-rendered>p { // 后来发现是 div > h1+\n+p+\n+p 这种情况引起的
|
|
1238
|
+
// line-height: 1; // 有时无margin也会有个很奇怪间隔,很奇怪
|
|
1239
|
+
// }
|
|
1240
|
+
.markdown-rendered tbody > tr {
|
|
1241
|
+
> td .markdown-rendered, > th .markdown-rendered {
|
|
1242
|
+
white-space: normal;
|
|
1243
|
+
}
|
|
1244
|
+
}
|