-
Notifications
You must be signed in to change notification settings - Fork 166
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
Fix alignment of heading icon #4736
Fix alignment of heading icon #4736
Conversation
Demo starting at https://vanilla-framework-4736.demos.haus |
scss/_patterns_heading-icon.scss
Outdated
@@ -22,25 +22,26 @@ | |||
height: map-get($icon-sizes, heading-icon--small); | |||
margin-bottom: 0; | |||
margin-right: $sph--large; | |||
margin-top: map-get($nudges, h3-mobile); | |||
margin-top: calc(map-get($nudges, h3-mobile) / 2); // just a quick fix, should be calculated based on line height and icon size |
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.
What is missing to do this calculation?
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 guess ideally instead of arbitrary pushing it, we should attempt to center the icon within line height of the heading, so the calculation would need to calculate the difference between icon size and line height and use half of that to position the icon.
Maybe I'll just do it if that helps with the mobile positioning.
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.
Does it center the icon, if you set the line-height of the icon to the same as the heading?
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.
No, the icon is not "within" a line height, it's an image in flex box, that has to be aligned relative to heading that follows it. And I don't think we should refactor the component now, we just need to adjust it to new heading sizes.
This component (heading icon) was causing problems before, both from design and development point of view, so we should probably have a look at deprecating or re-doing it with the component rebranding.
|
Standard:
Examples with other types of headings:
Small: Stacked:
Custom |
4b9f15e
to
f313693
Compare
I proactively fixed some of the issues with heading icons in ubuntu.com to hopefully make the update easier: canonical/ubuntu.com#12807 |
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.
Looking good!
Co-authored-by: ClementChaumel <clement.chaumel@gmail.com>
Done
Fixes heading icon alignment
Fixes WD-3211
QA
Screenshots