Skip to content

Commit e8a61a1

Browse files
add: enhance search box styles and responsiveness in custom CSS
1 parent 63a0db3 commit e8a61a1

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

src/css/custom.css

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484
--ifm-pre-padding: 1rem;
8585
--ifm-code-border-radius: 16px;
8686
--ifm-global-border-radius: 6px;
87+
--ifm-navbar-height: 4.5rem;
88+
--search-box-width: 30rem;
8789
}
8890

8991
/* Page background */
@@ -139,11 +141,18 @@ code {
139141
border-radius: 4px;
140142
}
141143

144+
@media screen and (max-width: 1200px) {
145+
:root {
146+
--search-box-width: 20rem;
147+
}
148+
}
149+
142150
/* Responsive adjustments */
143151
@media screen and (max-width: 768px) {
144152
:root {
145153
--ifm-code-border-radius: 12px;
146154
--ifm-pre-padding: 0.75rem;
155+
--search-box-width: auto;
147156
}
148157

149158
pre {
@@ -246,3 +255,37 @@ mark, :not(.prism-code) > code:not(.prism-code), .mark {
246255
grid-template-columns: 1fr !important;
247256
}
248257
}
258+
259+
.DocSearch.DocSearch-Button {
260+
align-items: center;
261+
outline-offset: 0.125rem;
262+
border-radius: 9999px;
263+
border: 1px solid rgba(255, 255, 255, .15);
264+
background: rgba(255, 255, 255, .05);
265+
color: #ffffff;
266+
display: flex;
267+
gap: 0.75rem;
268+
height: 2.5rem;
269+
padding-inline: 1rem;
270+
transition: opacity 0.2s ease-in-out;
271+
flex-grow: 1;
272+
width: var(--search-box-width);
273+
}
274+
275+
.DocSearch .DocSearch-Button-Container {
276+
opacity: 0.65;
277+
transition: opacity 0.2s ease-in-out;
278+
}
279+
280+
.DocSearch.DocSearch-Button:hover .DocSearch-Button-Container {
281+
opacity: 0.85;
282+
}
283+
284+
.DocSearch .DocSearch-Button-Key {
285+
font-size: 0.75rem;
286+
color: rgba(255, 255, 255, 0.5);
287+
border: 1px solid rgba(255, 255, 255, .15);
288+
background: rgba(255, 255, 255, .05);
289+
border-radius: 4px;
290+
padding: 0.125rem 0.25rem;
291+
}

0 commit comments

Comments
 (0)