Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/NcIconSvgWrapper/NcIconSvgWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ export default {
vertical-align: text-bottom;
}

// Icon svg wrapper
span {
line-height: 0;
}
Comment on lines +289 to +291
Copy link
Contributor

@ShGKme ShGKme May 2, 2025

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.

Copy link
Contributor

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.

Copy link
Contributor

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

flex which 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 👀

Copy link
Contributor

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.


&:deep(svg) {
fill: currentColor;
width: v-bind('iconSize');
Expand Down
Loading