Skip to content

Commit

Permalink
fix(icon): vertical position for unsized icons and sized text
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lubber-de authored Jun 12, 2020
1 parent 2cd5e9c commit 4ac35a7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/definitions/elements/icon.less
Original file line number Diff line number Diff line change
Expand Up @@ -288,15 +288,15 @@ each(@colors, {
i.icon,
i.icons {
font-size: @medium;
line-height: 1;
vertical-align: middle;
line-height: @lineHeight;
}
& when not (@variationIconSizes = false) {
each(@variationIconSizes, {
@s: @@value;
i.@{value}.@{value}.@{value}.icon,
i.@{value}.@{value}.@{value}.icons {
font-size: @s;
vertical-align: middle;
}
})
}
Expand Down
3 changes: 3 additions & 0 deletions src/definitions/elements/text.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
/*******************************
Text
*******************************/
span.ui.text {
line-height: @lineHeight;
}

each(@colors, {
@color: replace(@key, '@', '');
Expand Down
1 change: 1 addition & 0 deletions src/themes/default/elements/icon.variables
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
@width: @iconWidth;
@height: 1em;
@distanceFromText: 0.25rem;
@lineHeight: 1;


/* Variations */
Expand Down
2 changes: 2 additions & 0 deletions src/themes/default/elements/text.variables
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
/*-------------------
Element
--------------------*/
@lineHeight: 1;

@mini: 0.4em;
@tiny: 0.5em;
@small: 0.75em;
Expand Down

0 comments on commit 4ac35a7

Please sign in to comment.