Skip to content

Commit 45ac3fe

Browse files
authored
feat(dropdown): maintain a lower opacity of the clear icon unless being hovered
When the dropdown allows for clearing, the clear icon should maintain a lower opacity unless it's being hovered. This improves user experience by indicating the option to clear the selection only when the user interacts with it.
1 parent a517eeb commit 45ac3fe

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

src/definitions/modules/dropdown.less

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -616,14 +616,20 @@ select.ui.dropdown {
616616
.ui.ui.selection.dropdown@{notInverted}:has(> input:focus) {
617617
border-color: @selectionFocusBorderColor;
618618
box-shadow: none;
619-
& > i.icon {
620-
opacity: @selectionIconFocusOpacity;
619+
}
620+
621+
.ui.ui.selection.dropdown {
622+
&:focus,
623+
&:has(> input:focus) {
624+
& > i.icon:not(.remove) {
625+
opacity: @selectionIconFocusOpacity;
626+
}
627+
& > i.icon.remove:not(:hover) {
628+
opacity: @actionIconFocusOpacity;
629+
}
621630
}
622631
}
623632
}
624-
.ui.ui.selection.dropdown:focus > i.icon {
625-
opacity: @selectionIconFocusOpacity;
626-
}
627633

628634
/* Visible */
629635
.ui.selection.visible.dropdown > .text:not(.default) {

src/themes/default/modules/dropdown.variables

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@
220220
@selectionVisibleIconOpacity: "";
221221

222222
@selectionIconFocusOpacity: 1;
223+
@actionIconFocusOpacity: ((@selectionIconFocusOpacity * 68) / 100);
223224

224225
/* --------------
225226
Search

0 commit comments

Comments
 (0)