Skip to content

Commit

Permalink
Remove unnecessary classname
Browse files Browse the repository at this point in the history
  • Loading branch information
alimpens committed Dec 11, 2024
1 parent c7b4247 commit aca9af8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
8 changes: 4 additions & 4 deletions packages/css/src/components/header/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@
@include reset-button;
}

.ams-header__mega-menu-button[aria-expanded="true"] {
font-weight: var(--ams-header-mega-menu-button-label-open-font-weight);
}

.ams-header__mega-menu-button-label,
.ams-header__mega-menu-button-hidden-label {
grid-area: 1 / 1;
}

.ams-header__mega-menu-button-label--open {
font-weight: var(--ams-header-mega-menu-button-label-open-font-weight);
}

// This hidden label is used to prevent a layout shift when the mega menu is opened
// and the button text becomes bold.
.ams-header__mega-menu-button-hidden-label {
Expand Down
9 changes: 1 addition & 8 deletions packages/react/src/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,7 @@ const HeaderRoot = forwardRef(
onClick={() => setOpen(!open)}
type="button"
>
<span
className={clsx(
'ams-header__mega-menu-button-label',
open && 'ams-header__mega-menu-button-label--open',
)}
>
{menuButtonText}
</span>
<span className="ams-header__mega-menu-button-label">{menuButtonText}</span>
<span aria-hidden="true" className="ams-header__mega-menu-button-hidden-label">
{menuButtonText}
</span>
Expand Down

0 comments on commit aca9af8

Please sign in to comment.