Skip to content

Commit

Permalink
feat(icon): colored variant for bordered or circular
Browse files Browse the repository at this point in the history
This PR adds a colored variant to circular or bordered icon(s).

Currently the border of a circular or bordered icon is always grey. Even if the icon itself has got a color.
By adding a colored class to such icons the border will inherit its color from the icon itself.
  • Loading branch information
lubber-de authored Jan 25, 2021
1 parent 9ade8b7 commit ba420fe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/definitions/elements/icon.less
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ i.emphasized.icon:not(.disabled), i.emphasized.icons:not(.disabled) {
box-shadow: none;
}
}
&.colored when (@variationIconColored){
box-shadow: @coloredBoxShadow;
}
}

& when (@variationIconFlipped) {
Expand Down Expand Up @@ -289,6 +292,9 @@ i.emphasized.icon:not(.disabled), i.emphasized.icons:not(.disabled) {
box-shadow: none;
}
}
&.colored when (@variationIconColored){
box-shadow: @coloredBoxShadow;
}
}

& when (@variationIconInverted) {
Expand Down Expand Up @@ -445,6 +451,9 @@ i.icons {
height: @borderedSize;
box-shadow: @borderedShadow;
vertical-align: middle;
&.colored when (@variationIconColored){
box-shadow: @coloredBoxShadow;
}
}
i.circular.icons {
border-radius: 500em;
Expand Down
2 changes: 2 additions & 0 deletions src/themes/default/elements/icon.variables
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
@borderedHorizontalPadding: 0;
@borderedShadow: 0 0 0 0.1em rgba(0, 0, 0, 0.1) inset;

@coloredBoxShadow: 0 0 0 0.1em currentColor inset;

@cornerIconSize: 0.45em;
@cornerIconStroke: 1px;
@cornerIconShadow:
Expand Down
1 change: 1 addition & 0 deletions src/themes/default/globals/variation.variables
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
@variationIconLink: true;
@variationIconCircular: true;
@variationIconBordered: true;
@variationIconColored: true;
@variationIconRotated: true;
@variationIconFlipped: true;
@variationIconCorner: true;
Expand Down

0 comments on commit ba420fe

Please sign in to comment.