-
Notifications
You must be signed in to change notification settings - Fork 239
fix(typography): unintended typography element margins #5576
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
Conversation
|
📚 Branch Preview🔍 Visual Regression Test ResultsWhen a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:
Deployed to Azure Blob Storage: If the changes are expected, update the |
Tachometer resultsCurrently, no packages are changed by this PR... |
rise-erpelding
left a comment
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.
I'm not really sure if there's a great way to test this, but here's what I did when I was initially investigating the bug:
- Go to one of the Divider component's stories within Storybook
- Inspect the heading component there, confirm that it does have top and bottom margins
- Remove the
.spectrum-Typographyclass from the parentdiv, confirm that there are no margins
So far this works fine! But if I change the .spectrum-Heading class into .spectrum-Detail to test the same with the Detail component, it doesn't work. The detail has margins both with the parent .spectrum-Typography class and also without it, which isn't expected behavior, so I'm wondering if we missed something somewhere.
On the original PR that introduced the issue (#5295), I see that the same --spectrum-heading-margin-start/-end being added to .spectrum-Heading rather than only .spectrum-Typography .spectrum-Heading being introduced in tools/styles/fonts.css as well, so maybe we need to roll those changes back also? Although the margins work just fine for heading so I find that puzzling 🤔 See https://github.com/adobe/spectrum-web-components/blob/saasha/fix-typography-margin/tools/styles/fonts.css#L76-L77
Likewise, that same PR does the same thing for .spectrum-Detail margins in that fonts.css file, see https://github.com/adobe/spectrum-web-components/blob/saasha/fix-typography-margin/tools/styles/fonts.css#L505-L506, so maybe that can be reverted back to what it was before also?
I also see the same being introduced in that PR in tools/styles/typography.css, see https://github.com/adobe/spectrum-web-components/blob/saasha/fix-typography-margin/tools/styles/typography.css#L76-L77 and https://github.com/adobe/spectrum-web-components/blob/saasha/fix-typography-margin/tools/styles/typography.css#L505-L506
Not sure if that would create any effect that we'd notice locally or in the branch deploy urls, but it would at least fully roll back the change? 🤷♀️
e0bc47a to
efc93ce
Compare
Good catches! I've rolled back these additional areas where the |
rise-erpelding
left a comment
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.
Looks great!
efc93ce to
ba8b779
Compare
ba8b779 to
284e9b2
Compare
284e9b2 to
3041443
Compare
3041443 to
42776a6
Compare
Description
Removes
--spectrum-detail-margin-startand--spectrum-detail-margin-enddefinitions from.spectrum-Detailand.spectrum-Headingensuring margin custom properties are scoped only to .spectrum-Typography .spectrum-Heading and .spectrum-Typography .spectrum-Detail.Motivation and context
We recently made a change in the Typography CSS that unintentionally scoped margin custom properties more broadly than intended. Typography margin custom properties should only be scoped to .spectrum-Typography
Related issue(s)
Author's checklist
Reviewer's checklist
patch,minor, ormajorfeatures