/* autocomplete */ /* This file can be deprecated when AutoComplete is upstreamed to PVC + rolled out to dotcom https://github.com/github/primer/issues/796 ** AutoComplete relies on FormControl, Overlay and ActionList CSS */ /* Stacked label (default) */ .autocomplete-label-stacked { display: block; margin-bottom: 6px; } /* Inline label (non-default) */ .autocomplete-label-inline { display: inline; margin-right: 6px; } /* Switch to stacked at smaller viewport */ @media (max-width: 543.98px) { .autocomplete-label-inline { display: block; margin-bottom: 6px; } } /* Wrapper for the input and result elements to ensure alignment */ .autocomplete-body { position: relative; display: inline; } /* Wrapper and conditional styles for when an icon is added */ .autocomplete-embedded-icon-wrap { display: inline-flex; padding: 4px 8px; align-items: center; &:focus-within { border-color: var(--color-accent-fg); @mixin focusBoxShadowInset; } & .form-control { padding: 0; margin-left: 8px; border: none; box-shadow: none; &:focus { box-shadow: none; } &:focus-visible { box-shadow: none; } } } /* A pop up list of items used to show autocompleted results */ .autocomplete-results { position: absolute; left: 0; z-index: 99; width: max-content; min-width: 100%; max-height: 20em; overflow-y: auto; font-size: 13px; list-style: none; background: var(--color-canvas-overlay); border: var(--primer-borderWidth-thin, 1px) solid var(--color-border-default); border-radius: var(--primer-borderRadius-medium, 6px); box-shadow: var(--color-shadow-medium); } /* One of the items that appears within an autocomplete group ** Bold black text on white background */ .autocomplete-item { display: block; width: 100%; padding: 4px 8px; overflow: hidden; font-weight: var(--base-text-weight-semibold, 600); color: var(--color-fg-default); text-align: left; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; background-color: var(--color-canvas-overlay); border: 0; &:hover { color: var(--color-fg-on-emphasis); text-decoration: none; background-color: var(--color-accent-emphasis); /* Inherit color on all child elements to ensure enough contrast */ & * { color: inherit !important; } } &.selected, &[aria-selected='true'], &.navigation-focus { color: var(--color-fg-on-emphasis); text-decoration: none; background-color: var(--color-accent-emphasis); /* Inherit color on all child elements to ensure enough contrast */ & * { color: inherit !important; } } }