-
Notifications
You must be signed in to change notification settings - Fork 2
Fix experience between 880-1024 px widths #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
795a1ac
Fix experience between 880-1024 px widths
morsssss c3feadf
Change #sidebar width instead of #content area, plus cosmetic fixes
morsssss 8aeb301
Change CSS filename, improve main comment
morsssss a44e19d
Hide just mobile search control without hiding three-dot menu
morsssss b15e998
Safer selectors with id's and :has(), plus fallbacks for nonmajor bro…
morsssss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| /* These rules allow us to retain most elements of the desktop view between 880px and 1024px. | ||
| * We could extend these all the way to the traditional 768px breakpoint, | ||
| * but the width of our current left sidebar makes that undesirable. | ||
| * | ||
| * Mintlify provides an id for most of the areas we want to fix up. | ||
| * For the rest, they use a `lg:hidden` class on the element to be shown at desktop | ||
| * resolutions, and a just plain `hidden` class on the element to be shown at | ||
| * mobile resolution. | ||
| * | ||
| * Unfortunately in some cases we do need to select elements by using a few of classes. | ||
| * Ideally we'd have id's for these too. | ||
| */ | ||
|
|
||
| @media (min-width: 880px) { | ||
| /* Retain the left sidebar, but make it a little narrower */ | ||
| #sidebar { | ||
| display: block; | ||
| width: 16rem; | ||
| } | ||
|
|
||
| /* Retain left padding in main section so it doesn't overlap with the sidebar. | ||
| * Don't introduce new left margin in main section. | ||
| */ | ||
| #content-area { | ||
| padding-left: 21.5rem; | ||
| margin-left: -3rem; | ||
| } | ||
|
|
||
| /* Keep left sidebar font at 14px */ | ||
| #sidebar-content { | ||
| font-size: .875em; | ||
| } | ||
|
|
||
| /* Retain full searchbar */ | ||
| @supports selector(:has()) { | ||
| div:has(> #search-bar-entry) { | ||
| display: block; | ||
| } | ||
| } | ||
|
|
||
| @supports not selector(:has()) { | ||
| #navbar .h-full .hidden.flex-1.justify-center { | ||
| display: block; | ||
| } | ||
| } | ||
|
|
||
| /* Hide little search control */ | ||
| #search-bar-entry-mobile { | ||
| display: none; | ||
| } | ||
|
|
||
| /* Retain tabs */ | ||
| @supports selector(:has()) { | ||
| div:has(> .nav-tabs) { | ||
| display: block; | ||
| } | ||
| } | ||
|
|
||
| @supports not selector(:has()) { | ||
| #navbar .hidden.px-12.h-12 { | ||
| display: block; | ||
| } | ||
| } | ||
|
|
||
| /* Hide mobile menu */ | ||
| #navbar button.lg\:hidden { | ||
| display: none; | ||
| } | ||
| } | ||
|
|
||
| @media (min-width: 1024px) { | ||
| /* Use Mintlify's default styles at this width */ | ||
| #content-area { | ||
| padding-left: 23.7rem; | ||
| } | ||
|
|
||
| #sidebar { | ||
| width: 18rem; | ||
morsssss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The selector relies on generic class names that are likely to change. Similar to the searchbar selector above, ".hidden.px-12.h-12" is fragile and may break with Mintlify updates. Consider documenting this brittleness or using more stable alternatives if available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"px-12.h-12" are also too fragile. Are there other selectors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly, this is the other case where we don't have a unique, nonfragile selector. My only other idea was to see if we could work down from a more specifically selected parent, but to me that seems worse.
So, the two most fragile selectors here make the searchbar and tabs visible at this intermediate width. I believe the worst-case scenario here is that those will remain invisible, as they are now.