-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SkeletonBodyText] Add wrapper to SkeletonBodyText #9764
Conversation
@jesstelford Feel free to add/remove reviewers to this at your leisure, I'm a bit unfamiliar as to who else would be a good candidate! Also, let me know if you'd like to see a changelog entry for this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, but it needs a changset (patch) for the @shopify/polaris
package:
# in the root
yarn changeset
Wrap individual lines of SkeletonBodyText in a div with width 100% This allows the lines to fill available space in cases when width isn't specified, as an item in a HorizontalStack for example.
0919862
to
519a942
Compare
Thanks @jesstelford! I've added a changeset 😄 Let me know if it needs any changes. |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @shopify/[email protected] ### Minor Changes - [#9820](#9820) [`5fe84e33b`](5fe84e3) Thanks [@zakwarsame](https://github.com/zakwarsame)! - Added a `variant` prop to ActionList for applying avatar size and left indentation space and border to items ### Patch Changes - [#9773](#9773) [`a5f68c9a5`](a5f68c9) Thanks [@jesstelford](https://github.com/jesstelford)! - [Scrollable] shadow overlays scrollable content correctly. - [#9764](#9764) [`d3315de2e`](d3315de) Thanks [@andy-schneidr](https://github.com/andy-schneidr)! - Wrap SkeletonBodyText lines in a div (width 100%) - [#9831](#9831) [`078bddad1`](078bdda) Thanks [@zakwarsame](https://github.com/zakwarsame)! - Updated the user menu's avatar to include `name` - [#9828](#9828) [`80c87bb1a`](80c87bb) Thanks [@felipeleusin](https://github.com/felipeleusin)! - [Frame] Applies margin to Content when using sidebar ## @shopify/[email protected] ## [email protected] ### Patch Changes - Updated dependencies \[[`5fe84e33b`](5fe84e3), [`a5f68c9a5`](a5f68c9), [`d3315de2e`](d3315de), [`078bddad1`](078bdda), [`80c87bb1a`](80c87bb)]: - @shopify/[email protected] Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @shopify/[email protected] ### Minor Changes - [Shopify#9820](Shopify#9820) [`5fe84e33b`](Shopify@5fe84e3) Thanks [@zakwarsame](https://github.com/zakwarsame)! - Added a `variant` prop to ActionList for applying avatar size and left indentation space and border to items ### Patch Changes - [Shopify#9773](Shopify#9773) [`a5f68c9a5`](Shopify@a5f68c9) Thanks [@jesstelford](https://github.com/jesstelford)! - [Scrollable] shadow overlays scrollable content correctly. - [Shopify#9764](Shopify#9764) [`d3315de2e`](Shopify@d3315de) Thanks [@andy-schneidr](https://github.com/andy-schneidr)! - Wrap SkeletonBodyText lines in a div (width 100%) - [Shopify#9831](Shopify#9831) [`078bddad1`](Shopify@078bdda) Thanks [@zakwarsame](https://github.com/zakwarsame)! - Updated the user menu's avatar to include `name` - [Shopify#9828](Shopify#9828) [`80c87bb1a`](Shopify@80c87bb) Thanks [@felipeleusin](https://github.com/felipeleusin)! - [Frame] Applies margin to Content when using sidebar ## @shopify/[email protected] ## [email protected] ### Patch Changes - Updated dependencies \[[`5fe84e33b`](Shopify@5fe84e3), [`a5f68c9a5`](Shopify@a5f68c9), [`d3315de2e`](Shopify@d3315de), [`078bddad1`](Shopify@078bdda), [`80c87bb1a`](Shopify@80c87bb)]: - @shopify/[email protected] Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Wrap individual lines of SkeletonBodyText in a div with width 100% This allows the lines to fill available space in cases when width isn't specified, as an item in a HorizontalStack for example.
WHY are these changes introduced?
Fixes #9703
WHAT is this pull request doing?
Adds a
<div width=100%>
wrapper around<SkeletonBodyText>
lines, so that they'll fill available horizontal space.Before:
After:
As a note, in the example
<SkeletonThumbnail>
has a tendency to get squished in<HorizontalStack>
s. Is this something we want to address? The most straightforward workaround I've found is to just wrap it in a<div>
, no other styling required.How to 🎩
With the changes pulled down, run
yarn dev
and take a look at the examples underSkeletonBodyText
andSkeletonPage
- There shouldn't be any changes, with the exception ofSkeletonBodyText - Default
- The last line shows with a width of 80% now. I think this is closer to the intended behaviour, looking at the difference between the example in the doc and how it looks in the code sandbox 😮Copy-paste this code in
playground/Playground.tsx
:🎩 checklist
README.md
with documentation changes