Skip to content

Commit

Permalink
Fixed navigation spacing in Safari 18.3 (#7979)
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk authored Feb 12, 2025
1 parent 9be17e7 commit a9bae7f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
{% endif %}
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.6fdb9009.min.css' | url }}">
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.8608ea7d.min.css' | url }}">
{% if config.theme.palette %}
{% set palette = config.theme.palette %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.06af60db.min.css' | url }}">
Expand Down
8 changes: 5 additions & 3 deletions src/templates/assets/stylesheets/main/components/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,9 @@
// Hide nested navigation
&__toggle ~ & {
display: grid;
grid-template-rows: 0fr;
// Hack: we must set a minimum of 8px to work around a bug introduced in
// Safari 18.3, collapsing to a height of 0 – see https://t.ly/ViA3N
grid-template-rows: minmax(#{px2rem(8px)}, 0fr);
visibility: collapse;
opacity: 0;
transition:
Expand All @@ -571,7 +573,7 @@

// Show nested navigation when toggle is active or indeterminate
&__toggle:is(:checked, .md-toggle--indeterminate) ~ & {
grid-template-rows: 1fr;
grid-template-rows: minmax(#{px2rem(8px)}, 1fr);
visibility: visible;
opacity: 1;
transition:
Expand Down Expand Up @@ -726,7 +728,7 @@
// Hack: Always show active navigation tab on breakpoint screen, despite
// of checkbox being checked or not - see https://t.ly/Qc311
.md-nav[data-md-level="1"] {
grid-template-rows: 1fr;
grid-template-rows: minmax(#{px2rem(8px)}, 1fr);
visibility: visible;
opacity: 1;
}
Expand Down

0 comments on commit a9bae7f

Please sign in to comment.