diff --git a/.changeset/famous-ghosts-fold.md b/.changeset/famous-ghosts-fold.md new file mode 100644 index 00000000000..89bb243b151 --- /dev/null +++ b/.changeset/famous-ghosts-fold.md @@ -0,0 +1,5 @@ +--- +'@shopify/polaris': patch +--- + +Rounded `Navigation` at `mdDown` behind a feature flag diff --git a/polaris-react/src/components/Navigation/Navigation.module.css b/polaris-react/src/components/Navigation/Navigation.module.css index f75645460f6..3901a91bd32 100644 --- a/polaris-react/src/components/Navigation/Navigation.module.css +++ b/polaris-react/src/components/Navigation/Navigation.module.css @@ -52,6 +52,14 @@ .NavigationFrame-TopBarAndReframe { border-top-left-radius: var(--p-border-radius-300); + border-top-right-radius: var(--p-border-radius-300); + /* stylelint-disable-next-line -- polaris custom global property */ + margin-top: var(--pg-top-bar-height); + + @media (--p-breakpoints-md-up) { + border-top-right-radius: 0; + margin-top: 0; + } } .PrimaryNavigation { @@ -100,6 +108,16 @@ } } +.PrimaryNavigation-TopBarAndReframe { + padding-top: var(--p-space-500); + border-top-left-radius: var(--p-border-radius-300); + border-top-right-radius: var(--p-border-radius-300); + + @media (--p-breakpoints-md-up) { + border-top-right-radius: 0; + } +} + .LogoContainer { display: none; diff --git a/polaris-react/src/components/Navigation/Navigation.tsx b/polaris-react/src/components/Navigation/Navigation.tsx index 1bf8b7e22fd..87757fa6b89 100644 --- a/polaris-react/src/components/Navigation/Navigation.tsx +++ b/polaris-react/src/components/Navigation/Navigation.tsx @@ -8,6 +8,7 @@ import {classNames} from '../../utilities/css'; import {getWidth} from '../../utilities/get-width'; import {useFrame} from '../../utilities/frame'; import {useFeatures} from '../../utilities/features'; +import {useBreakpoints} from '../../utilities/breakpoints'; import {NavigationContext} from './context'; import {Section, Item} from './components'; @@ -37,6 +38,8 @@ export const Navigation: React.FunctionComponent & { }: NavigationProps) { const {logo} = useFrame(); const width = getWidth(logo, 104); + const features = useFeatures(); + const {mdUp} = useBreakpoints(); const logoMarkup = logo ? (
& { [location, onDismiss], ); - const features = useFeatures(); - return ( @@ -85,12 +86,12 @@ export const Navigation: React.FunctionComponent & { )} aria-labelledby={ariaLabelledBy} > - {mediaMarkup} + {mdUp || !features?.dynamicTopBarAndReframe ? mediaMarkup : null} {children}