Skip to content

Commit f3dc646

Browse files
authored
refactor: improve readability of _variables.css (#2359)
1 parent 8e419a0 commit f3dc646

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
lines changed

packages/docsearch-css/src/_variables.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
);
3939
--docsearch-key-shadow: inset 0 -2px 0 0 rgb(205, 205, 230),
4040
inset 0 0 1px 1px #fff, 0 1px 2px 1px rgba(30, 35, 90, 0.4);
41-
--docsearch-key-pressed-shadow: inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 1px 0 rgba(30,35,90,0.4);
41+
--docsearch-key-pressed-shadow: inset 0 -2px 0 0 #cdcde6,
42+
inset 0 0 1px 1px #fff, 0 1px 1px 0 rgba(30, 35, 90, 0.4);
43+
4244
/* footer */
4345
--docsearch-footer-height: 44px;
4446
--docsearch-footer-background: #fff;
@@ -66,7 +68,8 @@ html[data-theme='dark'] {
6668
);
6769
--docsearch-key-shadow: inset 0 -2px 0 0 rgb(40, 45, 85),
6870
inset 0 0 1px 1px rgb(81, 87, 125), 0 2px 2px 0 rgba(3, 4, 9, 0.3);
69-
--docsearch-key-pressed-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, 0 1px 1px 0 #0304094d;
71+
--docsearch-key-pressed-shadow: inset 0 -2px 0 0 #282d55,
72+
inset 0 0 1px 1px #51577d, 0 1px 1px 0 #0304094d;
7073
--docsearch-footer-background: rgb(30, 33, 54);
7174
--docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5),
7275
0 -4px 8px 0 rgba(0, 0, 0, 0.2);

packages/docsearch-css/src/button.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
justify-content: center;
5858
margin-right: 0.4em;
5959
position: relative;
60-
padding: 0px 0px 2px 0px;
61-
border: 0px;
60+
padding: 0 0 2px;
61+
border: 0;
6262
top: -1px;
6363
width: 20px;
6464
}
@@ -68,7 +68,7 @@
6868
box-shadow: var(--docsearch-key-pressed-shadow);
6969
}
7070

71-
@media (max-width: 768px) {
71+
@media (width <= 768px) {
7272
.DocSearch-Button-Keys,
7373
.DocSearch-Button-Placeholder {
7474
display: none;

packages/docsearch-css/src/modal.css

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,9 @@ svg.DocSearch-Hit-Select-Icon {
545545
height: 18px;
546546
justify-content: center;
547547
margin-right: 0.4em;
548-
padding: 0px 0px 1px 0px;
548+
padding: 0 0 1px;
549549
color: var(--docsearch-muted-color);
550-
border: 0px;
550+
border: 0;
551551
width: 20px;
552552
}
553553

@@ -564,7 +564,7 @@ assistive tech users */
564564
}
565565

566566
/* Responsive */
567-
@media (max-width: 768px) {
567+
@media (width <= 768px) {
568568
:root {
569569
--docsearch-spacing: 10px;
570570
--docsearch-footer-height: 40px;
@@ -643,6 +643,7 @@ assistive tech users */
643643
0% {
644644
opacity: 0;
645645
}
646+
646647
100% {
647648
opacity: 1;
648649
}

packages/website/src/css/custom.css

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@import url(fragments.css);
2-
@import 'tailwindcss/tailwind.css';
1+
@import url('fragments.css');
2+
@import url('tailwindcss/tailwind.css');
33

44
:root {
55
--ifm-font-size-base: 16px;
@@ -29,7 +29,7 @@ html[data-theme='dark'] {
2929
}
3030

3131
/* DocSearch x Algolia logo */
32-
@media (max-width: 565px) {
32+
@media (width <=565px) {
3333
.navbar__logo .docsearch-nav-logo {
3434
width: 70%;
3535
height: auto;
@@ -38,13 +38,12 @@ html[data-theme='dark'] {
3838
}
3939

4040
/* DocSearch x Algolia logo in sidebar */
41-
@media (min-width: 997px) {
41+
@media (width >=997px) {
4242
.theme-doc-sidebar-container .docsearch-nav-logo {
4343
height: auto;
4444
}
4545
}
4646

47-
4847
.docusaurus-highlight-code-line {
4948
background-color: rgba(0, 0, 0, 0.1);
5049
display: block;
@@ -119,7 +118,7 @@ html[data-theme='dark'] #hero-apply > div:first-child {
119118

120119
html[data-theme='dark'] .apply-form {
121120
background-image: radial-gradient(
122-
circle at 50% 0px,
121+
circle at 50% 0,
123122
rgb(72, 76, 122),
124123
rgb(35, 38, 59)
125124
);
@@ -181,7 +180,7 @@ html[data-theme='dark'] .docsearch-logo {
181180
opacity: 0.6;
182181
}
183182

184-
.header-github-link:before {
183+
.header-github-link::before {
185184
content: '';
186185
width: 24px;
187186
height: 24px;
@@ -190,7 +189,7 @@ html[data-theme='dark'] .docsearch-logo {
190189
no-repeat;
191190
}
192191

193-
html[data-theme='dark'] .header-github-link:before {
192+
html[data-theme='dark'] .header-github-link::before {
194193
background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E")
195194
no-repeat;
196195
}

0 commit comments

Comments
 (0)