Skip to content

Commit 4ac35a7

Browse files
authored
fix(icon): vertical position for unsized icons and sized text
This PR corrects/partly reverts the vertical alignment of unsized icons which unfortunately breaks the vertical alignment in most cases when icons are just used beside inline texts which is probably the most used case. I also recognized the text element needs the same line-height setting to avoid overlapping which is also fixed now.
1 parent 2cd5e9c commit 4ac35a7

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

src/definitions/elements/icon.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,15 +288,15 @@ each(@colors, {
288288
i.icon,
289289
i.icons {
290290
font-size: @medium;
291-
line-height: 1;
292-
vertical-align: middle;
291+
line-height: @lineHeight;
293292
}
294293
& when not (@variationIconSizes = false) {
295294
each(@variationIconSizes, {
296295
@s: @@value;
297296
i.@{value}.@{value}.@{value}.icon,
298297
i.@{value}.@{value}.@{value}.icons {
299298
font-size: @s;
299+
vertical-align: middle;
300300
}
301301
})
302302
}

src/definitions/elements/text.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
/*******************************
2323
Text
2424
*******************************/
25+
span.ui.text {
26+
line-height: @lineHeight;
27+
}
2528

2629
each(@colors, {
2730
@color: replace(@key, '@', '');

src/themes/default/elements/icon.variables

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
@width: @iconWidth;
5454
@height: 1em;
5555
@distanceFromText: 0.25rem;
56+
@lineHeight: 1;
5657

5758

5859
/* Variations */

src/themes/default/elements/text.variables

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
/*-------------------
66
Element
77
--------------------*/
8+
@lineHeight: 1;
9+
810
@mini: 0.4em;
911
@tiny: 0.5em;
1012
@small: 0.75em;

0 commit comments

Comments
 (0)