Skip to content

Commit

Permalink
fix(masthead): prevent extra space beneath megapanel columns in Safari (
Browse files Browse the repository at this point in the history
#11574)

### Related Ticket(s)

none

### Description

Fixes an issue that only presents on Safari where megamenu tabpanels are unnecessarily tall.

**Before:**
<img width="1841" alt="Screenshot 2024-02-22 at 3 44 56 PM" src="https://github.com/carbon-design-system/carbon-for-ibm-dotcom/assets/12532727/2648a3d6-f3b0-44b8-b6a1-970206b8ed0d">

**After:**
<img width="1841" alt="Screenshot 2024-02-22 at 3 44 47 PM" src="https://github.com/carbon-design-system/carbon-for-ibm-dotcom/assets/12532727/6520e5f5-6bf9-47eb-906d-285478a0ecd8">


### Changelog

**Changed**

- Prevents masthead megamenu tabpanels from displaying with excessive vertical space in Safari.


<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "test: e2e": Codesandbox examples and e2e integration tests -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
  • Loading branch information
jkaeser authored Feb 28, 2024
1 parent 9561716 commit 9c94338
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/styles/scss/components/masthead/_masthead-megamenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@
--#{$c4d-prefix}-masthead-max-height: calc(
100vh - var(--cds-spacing-09, 3rem) - var(--cds-layout-05, 4rem)
);
--#{$c4d-prefix}-masthead-overflow: overlay;
--#{$c4d-prefix}-masthead-overflow: auto;

display: block;
overflow: hidden overlay;
overflow: hidden auto;
background-color: $background;

&:focus {
Expand Down Expand Up @@ -421,6 +421,16 @@
display: block;

&.only-child {
/**
* Necessary to accommodate Safari issue with columns.
*
* Container height is calculated before breaking into specified number
* of columns, which causes extra blank whitespace beneath column content.
*/
.#{$prefix}--masthead__megamenu__category-group-content-wrapper {
display: inline;
}

.#{$prefix}--masthead__megamenu__category-group-heading {
@include make-col(1, 2);

Expand Down

0 comments on commit 9c94338

Please sign in to comment.