Skip to content

Commit

Permalink
Autocomplete item selected state (#2177)
Browse files Browse the repository at this point in the history
* for real though

* Create mighty-toes-nail.md

* Stylelint auto-fixes

* Update mighty-toes-nail.md

Co-authored-by: Actions Auto Build <actions@github.com>
  • Loading branch information
langermank and actions-user committed Jul 28, 2022
1 parent d8c218a commit add769c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/mighty-toes-nail.md
@@ -0,0 +1,5 @@
---
"@primer/css": patch
---

Autocomplete item selected state
30 changes: 26 additions & 4 deletions src/actionlist/action-list-item.scss
@@ -1,9 +1,9 @@
// stylelint-disable max-nesting-depth, selector-max-specificity, selector-max-compound-selectors

@mixin activeIndicatorLine {
@mixin activeIndicatorLine($padding-left: -$actionList-item-padding-horizontal) {
position: absolute;
top: calc(50% - 12px);
left: -$actionList-item-padding-horizontal;
left: $padding-left;
width: $spacer-1;
height: $spacer-4;
content: '';
Expand Down Expand Up @@ -113,10 +113,32 @@
}
}

// active state [aria-current]
// Autocomplete [aria-selected] items

&.ActionList-item--navActive,
&[aria-selected='true'] {
font-weight: $font-weight-normal;
background: var(--color-action-list-item-default-selected-bg);

@media (hover: hover) {
&:hover {
background-color: var(--color-action-list-item-default-hover-bg);
}
}

&::before,
+ .ActionList-item::before {
visibility: hidden;
}

// blue accent line
&::after {
@include activeIndicatorLine(-$spacer-1);
}
}

// active state [aria-current]

&.ActionList-item--navActive {
&:not(.ActionList-item--subItem) {
.ActionList-item-label {
font-weight: $font-weight-bold;
Expand Down

0 comments on commit add769c

Please sign in to comment.