diff --git a/UNRELEASED.md b/UNRELEASED.md index 1098b4325db..9126f55e0f1 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -7,6 +7,7 @@ ### Bug fixes - Fixed right padding styling issue with the `Tag` component and remove right padding on a removable `Tag` ([#2860](https://github.com/Shopify/polaris-react/pull/2860)). +- Fixed secondary navigation spacing when no icon is present ([#2874](https://github.com/Shopify/polaris-react/pull/2874)). ### Documentation diff --git a/src/components/Navigation/Navigation.scss b/src/components/Navigation/Navigation.scss index f08855da8e3..d5d6a219fa3 100644 --- a/src/components/Navigation/Navigation.scss +++ b/src/components/Navigation/Navigation.scss @@ -378,6 +378,10 @@ $secondary-item-font-size: rem(15px); } } +.SecondaryNavigation-noIcon { + margin-left: spacing(); +} + // Section styles .Section { @include unstyled-list; diff --git a/src/components/Navigation/components/Item/Item.tsx b/src/components/Navigation/components/Item/Item.tsx index dda7d47f25a..9210c04fb63 100644 --- a/src/components/Navigation/components/Item/Item.tsx +++ b/src/components/Navigation/components/Item/Item.tsx @@ -236,8 +236,13 @@ export function Item({ ({url: firstUrl}, {url: secondUrl}) => secondUrl.length - firstUrl.length, )[0]; + const SecondaryNavigationClassName = classNames( + styles.SecondaryNavigation, + !icon && styles['SecondaryNavigation-noIcon'], + ); + secondaryNavigationMarkup = ( -
+
{subNavigationItems.map((item) => { const {label, ...rest} = item;