Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Scope safari fix to only work with expected values
  • Loading branch information
amyleadem committed Dec 6, 2023
commit e7939f7df82a4e2180ad01a8031d8141d98a556f
8 changes: 7 additions & 1 deletion packages/usa-nav/src/styles/_usa-nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,14 @@ $expand-less-icon: map-merge(
// Safari-only fix that forces a vertical scrollbar when mobile menu is open.
// Only needed in the 15px immediately preceding $theme-header-min-width.
//
// Note: To prevent error, this fix is currently scoped to only work
// when $theme-header-min-width receives expected values. The setting is used
// primarily in at-media(), which only accepts breakpoints from $system-properties.
// Note: 15px is the current width of the Safari scrollbar.
// More details in https://github.com/uswds/uswds/pull/5443
$our-breakpoints: map-deep-get($system-properties, breakpoints, standard);

@if $theme-header-min-width != "none" {
@if map-has-key($our-breakpoints, $theme-header-min-width) {
$safari-header-bug-min-width: calc(
units($theme-header-min-width) - px-to-rem(15px)
);
Expand All @@ -493,4 +497,6 @@ $expand-less-icon: map-merge(
top: var(--scrolltop, 0);
}
}
} @else {
@warn '`#{$theme-header-min-width}` is not a valid USWDS project breakpoint. Valid values: #{map-keys($our-breakpoints)}';
}