-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTable.css
101 lines (99 loc) · 3.79 KB
/
Table.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
body {
/* 表格圆角大小 */
--table-radius: var(--size-2-3);
/* 表格按钮颜色 */
--table-btn-color: #fff;
/* 表格按钮背景色 */
--table-btn-bg: #ddd;
/* 表格头背景色 */
--table-header-bg: #f4f4f4;
/* 表格隔行背景色 */
--table-alt-line-bg: #f4f4f4;
/* 动画时间 */
--animation: 200ms var(--anim-motion-smooth);
}
.markdown-rendered table {
border-collapse: initial;
border-spacing: 0;
border: 0px !important;
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table) {
--table-white-space: break-all;
width: 100%;
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table) .table-editor {
width: 100%;
border: 0px;
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table) .table-col-btn {
border-top-right-radius: var(--table-radius);
border-bottom-right-radius: var(--table-radius);
color: var(--table-btn-color);
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table) .table-row-btn {
border-bottom-left-radius: var(--table-radius);
border-bottom-right-radius: var(--table-radius);
color: var(--table-btn-color);
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table)
:is(.table-col-btn, .table-row-btn, .table-col-drag-handle:hover, .table-row-drag-handle:hover) {
transition: var(--animation);
background-color: var(--table-btn-bg);
--table-drag-handle-color: var(--table-btn-color);
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table)
:is(tr:hover .table-row-drag-handle, th:hover .table-col-drag-handle) {
opacity: 1;
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table)
th:first-child:not(:has(:is(.table-row-drag-handle, .table-col-drag-handle):hover)) {
border-top-left-radius: var(--table-radius);
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table)
th:last-child:not(:has(.table-col-drag-handle:hover)) {
border-top-right-radius: var(--table-radius);
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table):has(.table-col-btn:hover)
th:last-child {
border-top-right-radius: 0;
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table)
tr:last-child
td:first-child {
border-bottom-left-radius: var(--table-radius);
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table):has(.table-row-btn:hover)
tr:last-child
td:first-child {
border-bottom-left-radius: 0;
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table)
tr:last-child
td:last-child {
border-bottom-right-radius: var(--table-radius);
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table):has(
:is(.table-col-btn, .table-row-btn):hover
)
tr:last-child
td:last-child {
border-bottom-right-radius: 0;
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table)
:is(th, td):not(:first-child) {
border-left: 0;
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table) tbody td {
border-top: 0;
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table) thead tr {
background-color: var(--table-header-bg);
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table) tbody tr:nth-of-type(2n) {
background-color: var(--table-alt-line-bg);
}
:is(.markdown-source-view.mod-cm6 .cm-table-widget .table-wrapper, .markdown-rendered table)
tbody
tr:nth-of-type(2n + 1) {
background-color: var(--background-primary);
}