Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Page -> Header] Ensure we only set min-width on title when title is …
…not long (Shopify#11504) ### WHY are these changes introduced? To prevent wrapping of titles prematurely, we included some CSS to ensure that the width of the Title element within the Page Header would always be at-minimum the width of its content. This causes issues when titles are long, as it can cause the layout of the rest of the header to go outside of the page. This PR ensures that we only use `min-width: fit-content` if we detect the title is not long and we can safely ensure it stays on a single line. For titles that are longer, they now wrap as before, to give space for the actions within the Header. ### Examples <img width="1588" alt="Screenshot 2024-01-25 at 16 21 43" src="https://github.com/Shopify/polaris/assets/2562596/a2f6e2b4-9df4-4a62-9b53-b643403061b1"> <img width="1588" alt="Screenshot 2024-01-25 at 16 21 36" src="https://github.com/Shopify/polaris/assets/2562596/3fae343e-eeb4-4892-8206-260813acbfb1"> <img width="1588" alt="Screenshot 2024-01-25 at 16 21 32" src="https://github.com/Shopify/polaris/assets/2562596/4fd6d4aa-d0cc-4f22-877b-608278d414c9"> ### How to 🎩 🖥 [Local development instructions](https://github.com/Shopify/polaris/blob/main/README.md#install-dependencies-and-build-workspaces) 🗒 [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) ### 🎩 checklist - [ ] Tested a [snapshot](https://github.com/Shopify/polaris/blob/main/documentation/Releasing.md#-snapshot-releases) - [x] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [x] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [x] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [x] Updated the component's `README.md` with documentation changes - [x] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
- Loading branch information