Skip to content

Commit

Permalink
fix(Label): changes selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
talkor committed Apr 7, 2024
1 parent 03378ba commit 4a24a17
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
30 changes: 15 additions & 15 deletions packages/core/src/components/Label/Label.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@import "../../styles/typography";
@import "../../styles/keyframes";

.clickable {
.clickableWrapper {
@include clickable.clickable;

&:active {
Expand Down Expand Up @@ -46,8 +46,8 @@
fill: var(--primary-color);
}

.clickable:hover &,
.clickable:active & {
&.clickable:hover,
&.clickable:active {
background-color: var(--primary-hover-color);
}
}
Expand All @@ -67,8 +67,8 @@
fill: var(--negative-color);
}

.clickable:hover &,
.clickable:active & {
&.clickable:hover,
&.clickable:active {
background-color: var(--negative-color-hover);
}
}
Expand All @@ -80,8 +80,8 @@
fill: var(--positive-color);
}

.clickable:hover &,
.clickable:active & {
&.clickable:hover,
&.clickable:active {
background-color: var(--positive-color-hover);
}
}
Expand All @@ -103,8 +103,8 @@
fill: var(--primary-color);
}

.clickable:hover &,
.clickable:active & {
&.clickable:hover,
&.clickable:active {
background-color: var(--primary-background-hover-color);
}
}
Expand All @@ -116,8 +116,8 @@
fill: var(--inverted-color-background);
}

.clickable:hover &,
.clickable:active & {
&.clickable:hover,
&.clickable:active {
background-color: var(--primary-background-hover-color);
}
}
Expand All @@ -129,8 +129,8 @@
fill: var(--negative-color);
}

.clickable:hover &,
.clickable:active & {
&.clickable:hover,
&.clickable:active {
background-color: var(--negative-color-selected);
}
}
Expand All @@ -142,8 +142,8 @@
fill: var(--positive-color);
}

.clickable:hover &,
.clickable:active & {
&.clickable:hover,
&.clickable:active {
background-color: var(--positive-color-selected);
}
}
Expand Down
7 changes: 4 additions & 3 deletions packages/core/src/components/Label/Label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ const Label: VibeComponent<LabelProps> & {
{
// When celebrationAnimation is active it wins over the default animation
[styles.withAnimation]: !isAnimationDisabled && !isCelebrationAnimation,
[styles.withLeg]: isLegIncluded
[styles.withLeg]: isLegIncluded,
[styles.clickable]: isClickable
},
labelClassName
),
[kind, color, isAnimationDisabled, isLegIncluded, labelClassName, isCelebrationAnimation]
[kind, color, isAnimationDisabled, isLegIncluded, labelClassName, isCelebrationAnimation, isClickable]
);

const onClickCallback = useCallback(
Expand Down Expand Up @@ -104,7 +105,7 @@ const Label: VibeComponent<LabelProps> & {
return (
<span
{...(isClickable && clickableProps)}
className={cx({ [styles.clickable]: isClickable }, overrideClassName)}
className={cx({ [styles.clickableWrapper]: isClickable }, overrideClassName)}
data-testid={dataTestId || getTestId(ComponentDefaultTestId.LABEL, id)}
ref={mergedRef}
>
Expand Down

0 comments on commit 4a24a17

Please sign in to comment.