Skip to content

Commit

Permalink
Fix search filters being hidden (modrinth#1205)
Browse files Browse the repository at this point in the history
* Fix search filters being hidden (#1165)

Previously, `max-width` was used to hide the sidebar on mobile, which
meant that at exactly 1024 pixels wide, the sidebar would be hidden.
However, this breakpoint is also as a
`min-width` other media queries, notably the ones used to enable viewing
filters on mobile sizes. This has caused issue #1024.

To fix this, I have swapped the logic of the rule that hides the filters
on mobile: it is now hidden by default and a `min-width` query is used
to show it on wider viewports. This is more consistent with similar media
queries in the same file.

Looking to the future, these issues should become less common if we
switch to range-based media queries:
https://caniuse.com/css-media-range-syntax

* Delete package-lock.json

---------

Co-authored-by: Prospector <[email protected]>
  • Loading branch information
MMK21Hub and Prospector authored Jun 20, 2023
1 parent 14b0e88 commit 247be0c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pages/search/[searchProjectType].vue
Original file line number Diff line number Diff line change
Expand Up @@ -848,13 +848,15 @@ export default defineNuxtComponent({
.normal-page__sidebar {
grid-row: 3;
// Hide on mobile unless open
@media screen and (max-width: 1024px) {
display: none;
// Always show on desktop
@media screen and (min-width: 1024px) {
display: block;
}
&.open {
display: block;
}
// Hide on mobile unless open
display: none;
&.open {
display: block;
}
}
Expand Down

0 comments on commit 247be0c

Please sign in to comment.