Skip to content

Commit 795a1ac

Browse files
committed
Fix experience between 880-1024 px widths
Tweak Mintlify CSS so that we don't simply show the quite inferior mobile view when someone shrinks their desktop browser window to <1024px width. Instead, continue to show the sidebar, the search bar, and most other elements until the window really gets too small.
1 parent bfb1d8d commit 795a1ac

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

styles.css

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/* These rules allow us to retain the desktop view until 880px. We could go all
2+
* the way to the traditional 768px breakpoint, but our left sidebar is rather wide.
3+
*
4+
* Mintlify provides an id for most of the areas we want to fix up.
5+
* For the rest, they use a `lg:hidden` class on the element to be shown at desktop
6+
* resolutions, and a just plan `hidden` class on the element to be shown at
7+
* mobile resolution.
8+
* Unfortunately in some cases we do need to specify more specific classes.
9+
*/
10+
11+
@media (min-width: 880px) {
12+
/* Retain the left sidebar, but make it a little narrower */
13+
#sidebar {
14+
display: block;
15+
width: 16rem;
16+
}
17+
18+
/* Retain left padding in main section so it doesn't overlap with the sidebar */
19+
#content-area {
20+
padding-left: 21.5rem;
21+
}
22+
23+
/* Don't introduce new left margin in main section */
24+
#content-area {
25+
margin-left: -3rem;
26+
}
27+
28+
/* Keep left sidebar font at 14px */
29+
#sidebar-content {
30+
font-size: .875em;
31+
}
32+
33+
/* Retain full searchbar */
34+
#navbar .h-full .hidden.flex-1.justify-center {
35+
display: block;
36+
}
37+
38+
#navbar .h-full .lg\:hidden {
39+
display: none;
40+
}
41+
42+
/* Retain tabs */
43+
#navbar .hidden.px-12.h-12 {
44+
display: block;
45+
}
46+
47+
/* Hide mobile menu */
48+
#navbar button.lg\:hidden {
49+
display: none;
50+
}
51+
}
52+
53+
@media (min-width: 1024px) {
54+
/* Use Mintlify's default styles at this width */
55+
#content-area {
56+
padding-left: 23.7rem;
57+
width: 18rem;
58+
}
59+
}

0 commit comments

Comments
 (0)