Skip to content

Commit

Permalink
Fix: Matching dropdown list style improvements (fixes adaptlearning#478
Browse files Browse the repository at this point in the history
…) (adaptlearning#507)

* only apply selected styles when a dropdown item has been selected

* apply border to dropdown list to distinguish end of list

* remove bottom border from last item to prevent double up of border
  • Loading branch information
kirsty-hames authored Apr 15, 2024
1 parent 599bab0 commit c77980a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions less/plugins/adapt-contrib-matching/dropdown.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,29 @@
}
}

.dropdown__list {
border: 0.19rem solid @item-color-selected;
}

.dropdown-item {
padding: @item-padding;
background-color: @item-color;
border-bottom: 1px solid @item-color-hover;
color: @item-color-inverted;

.no-touch &:not(:focus-visible):not([aria-selected="true"]):hover {
&:last-child {
border-bottom: none;
}

.no-touch &:not(:focus-visible):hover,
.dropdown__btn.is-selected + .dropdown__list &[aria-selected="true"]:hover {
background-color: @item-color-hover;
color: @item-color-inverted-hover;
.transition(background-color @duration ease-in, color @duration ease-in;);
}

&:focus-visible,
&[aria-selected="true"] {
.dropdown__btn.is-selected + .dropdown__list &[aria-selected="true"] {
// This code can be used to style a non-native dropdown as closely
// as possible to the default browser settings
// background-color: Highlight;
Expand Down

0 comments on commit c77980a

Please sign in to comment.