Skip to content

Commit faf6ef1

Browse files
committed
fix(css): separate docusaurus css variables
1 parent 61e455e commit faf6ef1

1 file changed

Lines changed: 24 additions & 28 deletions

File tree

src/style.css

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* Variables */
22

33
:root {
4+
45
/* Extract rgb from primary with JS
56
function extractRgb (css) {
67
return css.match(/[0-9.]+/gi)
@@ -9,24 +10,30 @@
910
--docsearch-primary-color-R: 84;
1011
--docsearch-primary-color-G: 104;
1112
--docsearch-primary-color-B: 255;
13+
1214
--docsearch-primary-color: rgb(
1315
var(--docsearch-primary-color-R),
1416
var(--docsearch-primary-color-G),
1517
var(--docsearch-primary-color-B)
1618
);
1719

18-
--docsearch-input-color: var(--ifm-color-emphasis-800);
19-
20+
--docsearch-spacing: 12px;
21+
--docsearch-icon-stroke-width: 1.4;
2022
--docsearch-highlight-color: var(--docsearch-primary-color);
21-
22-
--docsearch-placeholder-color: rgb(150, 155, 175);
23-
23+
--docsearch-text-color: var(--ifm-color-emphasis-900);
24+
--docsearch-muted-color: rgb(150, 159, 175);
2425
--docsearch-container-background: rgba(101, 108, 133, 0.8);
26+
--docsearch-logo-color: rgba(84,10,255);
2527

28+
/* modal */
29+
--docsearch-modal-width: 560px;
30+
--docsearch-modal-height: 600px;
2631
--docsearch-modal-background: var(--ifm-color-emphasis-100);
2732
--docsearch-modal-shadow: inset 1px 1px 0px 0px rgba(255, 255, 255, 0.5),
2833
0px 3px 8px 0px rgba(85, 90, 100, 1);
2934

35+
/* searchbox */
36+
--docsearch-searchbox-height: 56px;
3037
--docsearch-searchbox-background: var(--ifm-color-emphasis-300);
3138
--docsearch-searchbox-focus-background: white;
3239
--docsearch-searchbox-shadow: inset 0px 0px 0px 2px
@@ -37,11 +44,14 @@
3744
0.5
3845
);
3946

47+
/* hit */
48+
--docsearch-hit-height: 56px;
4049
--docsearch-hit-color: var(--ifm-color-emphasis-800);
4150
--docsearch-hit-active-color: white;
4251
--docsearch-hit-background: white;
4352
--docsearch-hit-shadow: 0px 1px 3px 0px rgb(212, 217, 225);
4453

54+
/* key */
4555
--docsearch-key-gradient: linear-gradient(
4656
-225deg,
4757
rgb(213, 219, 228) 0%,
@@ -50,26 +60,12 @@
5060
--docsearch-key-shadow: inset 0px -2px 0px 0px rgb(205, 205, 230),
5161
inset 0px 0px 1px 1px white, 0px 1px 2px 1px rgba(30, 35, 90, 0.4);
5262

63+
/* footer */
64+
--docsearch-footer-height: 44px;
5365
--docsearch-footer-background: white;
5466
--docsearch-footer-shadow: 0px -1px 0px 0px rgb(224, 227, 232),
5567
0px -3px 6px 0px rgba(69, 98, 155, 0.12);
5668

57-
--docsearch-logo-color: #5468ff;
58-
59-
--docsearch-muted-color: rgb(150, 159, 175);
60-
61-
--docsearch-modal-width: 560px;
62-
--docsearch-modal-height: 600px;
63-
64-
--docsearch-searchbox-height: 56px;
65-
66-
--docsearch-hit-height: 56px;
67-
68-
--docsearch-footer-height: 44px;
69-
70-
--docsearch-spacing: 12px;
71-
72-
--docsearch-icon-stroke-width: 1.4;
7369
}
7470

7571
/* Darkmode */
@@ -94,7 +90,7 @@ html[data-theme='dark'] {
9490
--docsearch-footer-background: rgb(30, 33, 54);
9591
--docsearch-footer-shadow: inset 0px 1px 0px 0px rgba(73, 76, 106, 0.5),
9692
0px -4px 8px 0px rgba(0, 0, 0, 0.2);
97-
--docsearch-logo-color: #fff;
93+
--docsearch-logo-color: rgb(255,255,255);
9894
--docsearch-muted-color: rgb(127, 132, 151);
9995
}
10096

@@ -110,7 +106,7 @@ html[data-theme='dark'] {
110106
cursor: pointer;
111107
align-items: center;
112108
background: var(--docsearch-searchbox-background);
113-
color: var(--ifm-color-emphasis-900);
109+
color: var(--docsearch-text-color);
114110
font-weight: 500;
115111
user-select: none;
116112
}
@@ -149,7 +145,7 @@ html[data-theme='dark'] {
149145
border-radius: 3px;
150146
background: var(--docsearch-key-gradient);
151147
box-shadow: var(--docsearch-key-shadow);
152-
color: var(--ifm-color-emphasis-600);
148+
color: var(--docsearch-muted-color);
153149
}
154150

155151
/* Body modifier */
@@ -234,11 +230,11 @@ html[data-theme='dark'] {
234230
border: none;
235231
outline: none;
236232
background: transparent;
237-
color: var(--docsearch-input-color);
233+
color: var(--docsearch-text-color);
238234
}
239235

240236
.DocSearch-Input::placeholder {
241-
color: var(--docsearch-placeholder-color);
237+
color: var(--docsearch-muted-color);
242238
}
243239

244240
.DocSearch-Input::-webkit-search-cancel-button,
@@ -299,7 +295,7 @@ html[data-theme='dark'] {
299295

300296
.DocSearch-Reset:hover {
301297
transition: background-color 0.1s ease-in;
302-
background: var(--ifm-color-emphasis-300);
298+
background: var(--docsearch-muted-color);
303299
}
304300

305301
.DocSearch-LoadingIndicator svg,
@@ -365,7 +361,7 @@ html[data-theme='dark'] {
365361

366362
.DocSearch-Commands {
367363
display: flex;
368-
color: var(--ifm-color-emphasis-600);
364+
color: var(--docsearch-muted-color);
369365
}
370366

371367
.DocSearch-Commands li {

0 commit comments

Comments
 (0)