Skip to content

Commit

Permalink
feat(icon): use corner offset variables
Browse files Browse the repository at this point in the history
Moved corner icon offsets into a variable, so one can easily adjust them
Added render condition to possibly reduce CSS
  • Loading branch information
lubber-de authored Dec 27, 2020
1 parent 7da17f7 commit de42d96
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/definitions/elements/icon.less
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,14 @@ each(@colors, {
i.inverted.@{color}.icon.icon.icon.icon.icon {
color: @l;
}
i.inverted.bordered.@{color}.icon.icon.icon.icon.icon,
i.inverted.circular.@{color}.icon.icon.icon.icon.icon,
i.inverted.bordered.@{color}.icons,
i.inverted.circular.@{color}.icons {
background-color: @c;
color: @white;
& when (@variationIconBordered) or (@variationIconCircular) {
i.inverted.bordered.@{color}.icon.icon.icon.icon.icon,
i.inverted.circular.@{color}.icon.icon.icon.icon.icon,
i.inverted.bordered.@{color}.icons,
i.inverted.circular.@{color}.icons {
background-color: @c;
color: @white;
}
}
}
})
Expand Down Expand Up @@ -392,37 +394,37 @@ i.icons {
i.icons .corner.icon {
top: auto;
left: auto;
right: 0;
bottom: 0;
right: @cornerOffset;
bottom: @cornerOffset;
font-size: @cornerIconSize;
text-shadow: @cornerIconShadow;
&:not(.rotated):not(.flipped) {
transform: none;
}
}
i.icons .icon.corner[class*="top right"] {
top: 0;
top: @cornerOffset;
left: auto;
right: 0;
right: @cornerOffset;
bottom: auto;
}
i.icons .icon.corner[class*="top left"] {
top: 0;
left: 0;
top: @cornerOffset;
left: @cornerOffset;
right: auto;
bottom: auto;
}
i.icons .icon.corner[class*="bottom left"] {
top: auto;
left: 0;
left: @cornerOffset;
right: auto;
bottom: 0;
bottom: @cornerOffset;
}
i.icons .icon.corner[class*="bottom right"] {
top: auto;
left: auto;
right: 0;
bottom: 0;
right: @cornerOffset;
bottom: @cornerOffset;
}
& when (@variationIconInverted) {
i.icons .inverted.corner.icon {
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 @@ -85,6 +85,7 @@
@cornerIconStroke @cornerIconStroke 0 @black
;

@cornerOffset: 0;
@borderedGroupCornerOffset: 1.15em;

@mini: 0.4em;
Expand Down

0 comments on commit de42d96

Please sign in to comment.