Skip to content

Commit ba420fe

Browse files
authored
feat(icon): colored variant for bordered or circular
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.
1 parent 9ade8b7 commit ba420fe

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/definitions/elements/icon.less

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ i.emphasized.icon:not(.disabled), i.emphasized.icons:not(.disabled) {
144144
box-shadow: none;
145145
}
146146
}
147+
&.colored when (@variationIconColored){
148+
box-shadow: @coloredBoxShadow;
149+
}
147150
}
148151

149152
& when (@variationIconFlipped) {
@@ -289,6 +292,9 @@ i.emphasized.icon:not(.disabled), i.emphasized.icons:not(.disabled) {
289292
box-shadow: none;
290293
}
291294
}
295+
&.colored when (@variationIconColored){
296+
box-shadow: @coloredBoxShadow;
297+
}
292298
}
293299

294300
& when (@variationIconInverted) {
@@ -445,6 +451,9 @@ i.icons {
445451
height: @borderedSize;
446452
box-shadow: @borderedShadow;
447453
vertical-align: middle;
454+
&.colored when (@variationIconColored){
455+
box-shadow: @coloredBoxShadow;
456+
}
448457
}
449458
i.circular.icons {
450459
border-radius: 500em;

src/themes/default/elements/icon.variables

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070
@borderedHorizontalPadding: 0;
7171
@borderedShadow: 0 0 0 0.1em rgba(0, 0, 0, 0.1) inset;
7272

73+
@coloredBoxShadow: 0 0 0 0.1em currentColor inset;
74+
7375
@cornerIconSize: 0.45em;
7476
@cornerIconStroke: 1px;
7577
@cornerIconShadow:

src/themes/default/globals/variation.variables

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
@variationIconLink: true;
7272
@variationIconCircular: true;
7373
@variationIconBordered: true;
74+
@variationIconColored: true;
7475
@variationIconRotated: true;
7576
@variationIconFlipped: true;
7677
@variationIconCorner: true;

0 commit comments

Comments
 (0)