Skip to content

Commit 92d111f

Browse files
matmkiangcornut
authored andcommitted
chore(color): fix default icon color
1 parent 966e81a commit 92d111f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/lumx-core/src/scss/core/state/_mixins.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
@mixin lumx-state-low($state, $color, $has-focus-inset: false) {
8383
@if $state == lumx-base-const('state', 'DEFAULT') {
8484
background-color: transparent;
85+
color: lumx-color-variant($color, 'N');
8586
} @else if $state == lumx-base-const('state', 'HOVER') {
8687
background-color: lumx-color-variant($color, 'L5');
8788
} @else if $state == lumx-base-const('state', 'ACTIVE') {

packages/lumx-react/src/components/icon/Icon.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,20 @@ const DEFAULT_PROPS: Partial<IconProps> = {};
5252
*/
5353
export const Icon: Comp<IconProps, HTMLElement> = forwardRef((props, ref) => {
5454
const { className, color, colorVariant, hasShape, icon, size, theme, ...forwardedProps } = props;
55+
5556
let iconColor;
57+
let iconColorVariant;
5658
if (color) {
5759
iconColor = color;
60+
iconColorVariant = colorVariant;
5861
} else if (theme) {
5962
iconColor = theme === Theme.light ? ColorPalette.dark : ColorPalette.light;
63+
64+
if (colorVariant) {
65+
iconColorVariant = colorVariant;
66+
} else {
67+
iconColorVariant = Theme.light ? 'L1' : 'N';
68+
}
6069
} else if (hasShape) {
6170
iconColor = ColorPalette.dark;
6271
}
@@ -86,7 +95,7 @@ export const Icon: Comp<IconProps, HTMLElement> = forwardRef((props, ref) => {
8695
className,
8796
handleBasicClasses({
8897
color: iconColor,
89-
colorVariant,
98+
colorVariant: iconColorVariant,
9099
hasShape,
91100
prefix: CLASSNAME,
92101
size: iconSize,

0 commit comments

Comments
 (0)