From 79e604b340c4a80fcd45ab40a19c8210319bbea5 Mon Sep 17 00:00:00 2001 From: Yuraima Estevez Date: Wed, 19 Jul 2023 16:57:52 +0100 Subject: [PATCH] Updated `Breadcrumb` back button styling (#9733) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### WHY are these changes introduced? Fixes https://github.com/Shopify/polaris-summer-editions/issues/947 by overriding the styles of `Button` when in the Page Header. This follows the same solution that the other buttons in the page [secondary actions button groups use](https://github.com/Shopify/polaris/blob/4d018664742bc3c9e7c4b577d31dcd05d09a2a6f/polaris-react/src/components/ActionMenu/components/SecondaryAction/SecondaryAction.scss#L8) ### WHAT is this pull request doing? https://github.com/Shopify/polaris/assets/4642404/2ecc28a3-f320-4ea7-aa41-e84f07db33c8 ### How to 🎩 🖥 [Local development instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development) 🗒 [General tophatting guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md) 📄 [Changelog guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)
Copy-paste this code in playground/Playground.tsx: ```jsx import React from 'react'; import {Page} from '../src'; export function Playground() { return ( {/* Add the code you want to test in here */} ); } ```
### 🎩 checklist - [ ] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [ ] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide --------- Co-authored-by: Aaron Casanova <32409546+aaronccasanova@users.noreply.github.com> --- .changeset/fifty-bats-visit.md | 5 ++++ .../components/Breadcrumbs/Breadcrumbs.tsx | 22 +++++++++++++++++- .../Page/components/Header/Header.scss | 23 +++++++++++++++++++ polaris-react/src/types.ts | 2 +- 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 .changeset/fifty-bats-visit.md diff --git a/.changeset/fifty-bats-visit.md b/.changeset/fifty-bats-visit.md new file mode 100644 index 00000000000..0e89900f6e9 --- /dev/null +++ b/.changeset/fifty-bats-visit.md @@ -0,0 +1,5 @@ +--- +'@shopify/polaris': minor +--- + +empty diff --git a/polaris-react/src/components/Breadcrumbs/Breadcrumbs.tsx b/polaris-react/src/components/Breadcrumbs/Breadcrumbs.tsx index 39f68a2673e..3a2ed8d1972 100644 --- a/polaris-react/src/components/Breadcrumbs/Breadcrumbs.tsx +++ b/polaris-react/src/components/Breadcrumbs/Breadcrumbs.tsx @@ -6,6 +6,8 @@ import {UnstyledLink} from '../UnstyledLink'; import type {CallbackAction, LinkAction} from '../../types'; import {handleMouseUpByBlurring} from '../../utilities/focus'; import {Text} from '../Text'; +import {Button} from '../Button'; +import {useFeatures} from '../../utilities/features'; import styles from './Breadcrumbs.scss'; @@ -16,6 +18,7 @@ export interface BreadcrumbsProps { export function Breadcrumbs({backAction}: BreadcrumbsProps) { const {content} = backAction; + const {polarisSummerEditions2023} = useFeatures(); const contentMarkup = ( <> @@ -52,5 +55,22 @@ export function Breadcrumbs({backAction}: BreadcrumbsProps) { ); - return ; + const summerEditionsBreadcrumbMarkup = ( +