-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.less
230 lines (225 loc) · 4.82 KB
/
index.less
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
@w-code-preview:~ "w-code-preview";
[data-color-mode*='light'],
[data-color-mode*='light'] body {
--color-code-preview-bg: #fff3;
--color-code-preview-border: #d5d5d5;
--color-code-preview-hover: #838383;
--code-preview-text: #d5d5d5;
}
[data-color-mode*='dark'],
[data-color-mode*='dark'] body {
--color-code-preview-border: #ffffff1a;
--color-code-preview-bg: #282c34;
--color-code-preview-hover: #9c9c9c;
--code-preview-text: #c9d1d9;
}
.@{w-code-preview} {
&.w-split-horizontal > .w-split-bar {
height: initial;
}
> .w-split-bar {
background-color: var(--color-code-preview-bg) !important;
box-shadow: inset 1px 0 0 0 var(--color-code-preview-border), 1px 0 0 0 var(--color-code-preview-border) !important;
}
}
.@{w-code-preview} {
border-radius: 3px;
margin-bottom: 16px;
background-color: var(--color-code-preview-bg) !important;
// color: transparent !important;
max-height: 420px;
min-height: 12px;
z-index: 10;
position: relative;
&-bordered {
box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.1), 0 0 0 rgba(16, 22, 26, 0), 0 1px 1px rgba(16, 22, 26, 0.2);
}
&-fullScreen {
position: fixed;
border-radius: 0;
border: 0;
top: 0 !important;
left: 0 !important;
bottom: 0 !important;
margin: 0 !important;
right: 0 !important;
height: 100% !important;
max-height: 100% !important;
z-index: 99999;
}
&-demo-source {
input {
margin: initial;
vertical-align: initial;
}
blockquote,
details,
dl,
ol,
p,
pre,
table,
ul {
margin-bottom: initial;
margin-top: initial;
}
pre,
code,
tt {
font-family: inherit;
}
img {
max-width: initial;
}
h1,
h2 {
border-bottom: initial;
padding-bottom: initial;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: initial;
line-height: initial;
margin-bottom: initial;
margin-top: initial;
font-size: initial;
}
ul {
margin-bottom: initial;
margin-top: initial;
list-style: initial;
}
}
&-demo {
border-radius: 3px;
position: relative;
overflow: auto;
min-width: 100px;
position: relative;
padding: 15px;
min-height: 80px;
&-error {
z-index: 2;
background-color: var(--color-code-preview-bg);
width: 100%;
height: 100%;
margin-bottom: 0 !important;
color: #dc3545 !important;
}
&-bgPlaid:not(&-error) {
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cpattern id='a' width='16' height='16' patternUnits='userSpaceOnUse'%3E%3Cpath fill='rgba(0, 0, 0, 0.06)' d='M0 0h8v8H0zM8 8h8v8H8z'/%3E%3C/pattern%3E%3Crect fill='url(%23a)' width='100%25' height='100%25'/%3E%3C/svg%3E");
}
&-source.error {
display: none;
}
}
&-noScroll {
max-height: initial;
}
&-noScroll:not(&-fullScreen) &-demo {
overflow: inherit;
}
&-bgPlaid {
box-sizing: border-box;
position: absolute;
left: 0;
bottom: 0;
right: 0;
top: 0;
svg {
opacity: 0.7;
}
}
&-bar {
cursor: pointer;
box-shadow: inset 1px 0 0 0 var(--color-code-preview-border);
padding: 3px 0 8px 0;
margin: 0 auto;
writing-mode: tb-rl;
position: relative;
display: flex;
align-items: center;
width: 29px;
line-height: 24px;
font-size: 12px;
max-width: 29px;
min-width: 29px;
min-height: 29px;
&-btn {
overflow: hidden;
padding: 5px 0 10px 0;
display: flex;
transition: all 0.3s;
font-weight: bold;
user-select: none;
color: var(--code-preview-text);
flex: 1;
&:hover {
color: var(--color-code-preview-hover);
}
}
&-iconbtns {
margin-top: 6px;
height: 14px;
width: 14px;
line-height: 22px;
}
svg {
transition: all 0.3s;
fill: var(--code-preview-text);
display: block;
&:hover {
fill: var(--color-code-preview-hover);
}
}
&-copied svg,
&-copied svg:hover {
fill: #28a745;
}
}
&-OneItem &-bar {
cursor: inherit;
}
}
.@{w-code-preview} {
&-thirdparty + &-thirdparty {
margin-left: 10px;
}
&-thirdparty {
display: inline-block;
position: absolute;
white-space: nowrap;
line-height: 1;
z-index: 2;
right: 0;
top: -23px;
form {
display: block;
}
form + form {
margin-right: 5px;
}
button {
border: 0;
outline: 0;
cursor: pointer;
padding: 3px 4px 3px 4px;
border-radius: 3px;
transition: color 0.3s;
color: rgba(0, 0, 0, 0.45);
&:hover {
color: rgba(0, 0, 0, 0.85);
}
svg {
fill: var(--code-preview-text);
}
svg:not(:root) {
overflow: hidden;
}
}
}
}