-
Notifications
You must be signed in to change notification settings - Fork 95
fix(NcIconSvgWrapper): center svg span wrapper #6869
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
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de> Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
|
/backport to stable8 |
| span { | ||
| line-height: 0; | ||
| } |
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'd say that the root issue is that this span is a text (inline) element, which applies the line-height.
Instead of overriding text height to 0 of a non-text text element, I'd propose to make it a block or inline-block element.
I am unsure line-height won't be overridden by some a11y extension or have other browser-specific issues.
So I'd consider it a more risky solution than making it a non-text element.
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.
Block does not help as it still considers the line height.
Either set line height like here or use either grid (makes no sense) or flex which will fit content.
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.
Block does not help as it still considers the line height.
Hmm, indeed
flexwhich will fit content.
Yep, flex/inline-flex/grid works fine.
Or display: contents
makes no sense
IMO, it makes more sense, as it sets a more relevant box type, than changing line-height of non-text 👀
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.
Or display: contents
This seems to be the ideal solution, totally forgot about that.
| span { | ||
| line-height: 0; | ||
| } |
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.
Block does not help as it still considers the line height.
Either set line height like here or use either grid (makes no sense) or flex which will fit content.
ShGKme
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.
Non blocking
|
/backport to stable8 |
Parent is flex, but not the intermediate span
See the folder icon:
Before
After