-
Notifications
You must be signed in to change notification settings - Fork 10
/
styles.css
175 lines (155 loc) · 4.22 KB
/
styles.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
.obsidian-embedded-code-title__code-block-title {
position: absolute !important;
top: 0;
left: 0;
width: 100%;
/* font-size: 85%!important; */
padding: 3px !important;
padding-left: 15px !important;
margin: 0 !important;
border-radius: 0 !important;
}
.copy-code-button{
margin-top: 42px !important; /* 为自带的按钮增加上边距 */
}
pre[class*=language-] {
font-size: var(--editor-font-size);
line-height: 1.5em;
padding-bottom: 0px;
}
.obsidian-embedded-code-title__code-block-title + code[class*=language-]{
padding: 0em 0em 0em 0em !important;
/* padding-top: 0 !important; */
font-size: var(--editor-font-size) !important;
line-height: 1.5em !important;
}
/* pre[class*=language-] > code[class*=language-] {
padding: 0em 0em 0em 0.5em !important;
/* padding-top: 0 !important; */
/* font-size: var(--editor-font-size) !important;
line-height: 1.5em !important;
} */
pre[class*=language-].code-block-pre__has-linenum {
padding-left: 3.5em;
}
.code-block-pre__has-linenum::before {
padding-top: 6px;
}
/* 代码行号 */
.code-block-linenum-wrap {
position: absolute;
/* top: 35px; */
left: 0px;
min-width: 3em;
font-size: var(--editor-font-size);
line-height: 1.5em;
counter-reset: line-num;
text-align: center;
/* border-right: #999 2px solid; 行号与代码间分隔线 */
user-select: none;
pointer-events: none;
background-color: transparent;
/* background-color: inherit; */
}
.code-block-linenum-wrap .code-block-linenum {
display: block;
counter-increment: line-num;
pointer-events: none;
}
.code-block-linenum-wrap .code-block-linenum::before {
content: counter(line-num);
}
/* 代码高亮 */
pre[class*=language-] .code-block-highlight-wrap {
margin: 0;
padding: 0;
position: absolute;
left: 0px;
top: 35px;
width: 100%;
height: 100%;
background-color: transparent;
pointer-events: none;
}
pre[class*=language-] .code-block-highlight-wrap span {
display: block;
height: 1.5em;
width: 100%;
}
/* 折叠代码块 */
:root {
--admonition-details-icon: url("data:image/svg+xml;charset=utf-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M8.59 16.58L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z'/></svg>");
}
.obsidian-embedded-code-title__code-block-title{
line-height: 35px;
height: 35px !important;
color: currentColor !important;
}
.obsidian-embedded-code-title__code-block-title .langName {
display: inline;
float: right;
line-height: 29px;
margin-right: 35px;
font-weight: bold;
font-size: 14px;
font-family: var(--font-default);
}
.obsidian-embedded-code-title__code-block-title .collapser {
position: absolute;
top: 50%;
right: 8px;
transform: translateY(-50%);
content: "";
}
.obsidian-embedded-code-title__code-block-title .collapser .handle {
transform: rotate(90deg);
transition: transform 0.25s;
background-color: currentColor;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: contain;
mask-size: contain;
-webkit-mask-image: var(--admonition-details-icon);
mask-image: var(--admonition-details-icon);
width: 20px;
height: 20px;
}
.obsidian-embedded-code-title__code-block-title[closed] .collapser .handle{
transform: rotate(0deg);
}
.obsidian-embedded-code-title__code-block-title[closed] + code{
height: 0;
}
.obsidian-embedded-code-title__code-block-title[closed] + code + span{
height: 0;
}
.obsidian-embedded-code-title__code-block-title[closed] + code + span span{
visibility: hidden;
}
.obsidian-embedded-code-title__code-block-title[closed] + code + span + span span{
visibility: hidden;
}
.obsidian-embedded-code-title__code-block-title > .title {
display: inline-block;
position: relative;
margin-left: 5px !important;
margin: 0;
padding: 0;
top: 50%;
transform: translateY(-50%);
}
/* .obsidian-embedded-code-title__code-block-title > .icon-wrap {
display: inline-block;
position: relative;
width: 20px;
height: 20px;
background-position: center;
top: 50%;
transform: translateY(-50%);
} */
.code-block-wrap > pre > code[class*=language-]{
padding: 0em 0em 0em 0em !important;
/* padding-top: 0 !important; */
font-size: var(--editor-font-size) !important;
line-height: 1.5em !important;
}