/
code-tabs.scss
118 lines (90 loc) · 1.85 KB
/
code-tabs.scss
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
@use "vuepress-shared/styles/reset";
.code-tabs-nav {
overflow-x: auto;
margin: 0.85rem 0 -0.85rem;
padding: 0;
border-radius: 6px 6px 0 0;
background: var(--code-tabs-nav-bg-color, #3a404c);
list-style: none;
white-space: nowrap;
transition: background var(--t-color, 0.3s ease);
@media (max-width: hope-config.$mobile) {
margin-right: -1.5rem;
margin-left: -1.5rem;
border-radius: 0;
}
}
.code-tabs-nav-tab {
@include reset.button;
position: relative;
min-width: 3rem;
margin: 0;
padding: 6px 10px;
border-radius: 6px 6px 0 0;
background: transparent;
color: var(--code-tabs-nav-text-color, #eee);
font-weight: 600;
font-size: 0.85em;
line-height: 1.4;
cursor: pointer;
transition: background var(--t-color, 0.3s ease),
color var(--t-color, 0.3s ease);
&:hover {
background: var(--code-tabs-nav-hover-color, #434a57);
}
&::before,
&::after {
content: " ";
position: absolute;
bottom: 0;
z-index: 1;
width: 6px;
height: 6px;
}
&::before {
right: 100%;
}
&::after {
left: 100%;
}
&.active {
background: var(--code-bg-color, #282c34);
&::before {
background: radial-gradient(
12px at left top,
transparent 50%,
var(--code-bg-color, #282c34) 50%
);
}
&::after {
background: radial-gradient(
12px at right top,
transparent 50%,
var(--code-bg-color, #282c34) 50%
);
}
}
&:first-child {
&::before {
display: none;
}
}
}
.code-tab {
display: none;
&.active {
display: block;
}
div[class*="language-"] {
border-top-left-radius: 0;
border-top-right-radius: 0;
@media (max-width: hope-config.$mobile) {
margin: 0.85rem -1.5rem;
}
code {
@media print {
white-space: pre-wrap;
}
}
}
}