-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathcustom.css
More file actions
153 lines (131 loc) · 3.91 KB
/
Copy pathcustom.css
File metadata and controls
153 lines (131 loc) · 3.91 KB
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
/* color-scheme for light/default appearance */
:root {
--active-bg: white;
--active-color: black;
--active-border: #0969da;
--inactive-bg: #eee;
--inactive-color: #666;
--inactive-border: #ccc;
--neutral-border: #aaa;
}
/* color-scheme for dark mode */
@media (prefers-color-scheme: dark) {
:root {
--active-bg: black;
--active-color: white;
--active-border: #0969da;
--inactive-bg: black;
--inactive-color: #aaa;
--inactive-border: #666;
--neutral-border: #666;
}
}
/* hide content in the non-current language */
.page-language-ts .js-only,
.page-language-ts .code-couple .language-js.highlighter-rouge {
display: none;
}
.page-language-js .ts-only,
.page-language-js .code-couple .language-ts.highlighter-rouge {
display: none;
}
.hidden {
display: none;
}
/* Suffix like "(TS)" / "(JS)" attached to language-paired inline links
(e.g. download-solution links). Visible in raw markdown for readability,
hidden on the rendered site — the surrounding .ts-only / .js-only span
already disambiguates the language once one of the pair is displayed. */
.lang-suffix {
display: none;
}
/* tabbed switchable language area */
.code-couple-button {
margin-top: 8px;
padding: 10px 20px;
border-width: 2px;
border-style: solid;
border-bottom-width: 0;
border-radius: 16px 16px 0 0;
cursor: pointer;
}
/* active */
.code-couple-button-active {
color: var(--active-color);
background-color: var(--active-bg);
font-weight: bold;
border-color: var(--active-border);
}
/* inactive */
.code-couple-button-inactive {
color: var(--inactive-color);
background-color: var(--inactive-bg);
border-color: var(--inactive-border);
}
/* default state based on page language */
.page-language-ts .code-couple-button-ts:not(.code-couple-button-active):not(.code-couple-button-inactive),
.page-language-js .code-couple-button-js:not(.code-couple-button-active):not(.code-couple-button-inactive) {
color: var(--active-color);
background-color: var(--active-bg);
font-weight: bold;
}
.page-language-ts .code-couple-button-js:not(.code-couple-button-active):not(.code-couple-button-inactive),
.page-language-js .code-couple-button-ts:not(.code-couple-button-active):not(.code-couple-button-inactive) {
color: var(--inactive-color);
background-color: var(--inactive-bg);
}
.code-couple-container {
border: 1px solid var(--neutral-border);
}
/* overall language switch buttons */
.language-switch-container {
position: fixed;
top: 10px;
right: 10px;
display: flex;
gap: 5px;
z-index: 1000;
}
.language-switch-button {
background-color: var(--inactive-bg);
color: var(--inactive-color);
border-color: var(--inactive-border);
border-width: 2px;
border-style: solid;
border-radius: 5px;
padding: 5px 10px;
cursor: pointer;
transition: opacity 0.3s, background-color 0.3s;
opacity: 1;
}
body.page-language-js .language-switch-button.lang-js,
body.page-language-ts .language-switch-button.lang-ts {
background-color: var(--active-bg);
color: var(--active-color);
border-color: var(--active-border);
}
li > section.ts-only, li > section.js-only {
display: inline;
}
.language-switch-button:hover {
opacity: 0.8;
background-color: rgba(20, 20, 20, 0.8);
}
/* for OS dark theme */
@media (prefers-color-scheme: dark) {
.language-switch-button {
border-color: var(--inactive-border);
color: var(--inactive-color);
background-color: var(--inactive-bg);
}
body.page-language-js .language-switch-button.lang-js,
body.page-language-ts .language-switch-button.lang-ts {
background-color: var(--active-bg);
color: var(--active-color);
border-color: var(--active-border);
}
}
#__bs_notify__ {
background-color: rgba(27, 32, 50, 0.3) !important;
top: 40px !important;
}