/* autocomplete */ /* This file can be deprecated when AutoComplete is upstreamed to YVC + rolled out to dotcom https://github.com/github/yattho/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; } .autocomplete-embedded-icon-wrap:focus-within { border-color: var(--color-accent-fg); border-color: var(--color-accent-fg); outline: none; box-shadow: inset 0 0 0 1px var(--color-accent-fg); } .autocomplete-embedded-icon-wrap .form-control { padding: 0; margin-left: 8px; border: none; box-shadow: none; } .autocomplete-embedded-icon-wrap .form-control:focus { box-shadow: none; } .autocomplete-embedded-icon-wrap .form-control: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(--yattho-borderWidth-thin, 1px) solid var(--color-border-default); border-radius: var(--yattho-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; } .autocomplete-item: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 */ } .autocomplete-item:hover * { color: inherit !important; } .autocomplete-item.selected, .autocomplete-item[aria-selected='true'], .autocomplete-item.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 */ } .autocomplete-item.selected *, .autocomplete-item[aria-selected='true'] *, .autocomplete-item.navigation-focus * { color: inherit !important; }