/* dropdown */ .dropdown { position: relative; } .dropdown-caret { display: inline-block; width: 0; height: 0; vertical-align: middle; content: ''; border-style: solid; border-width: var(--borderWidth-thicker) var(--borderWidth-thicker) 0; border-right-color: transparent; border-bottom-color: transparent; border-left-color: transparent; } /* Requires a positioning class (e.g., `.dropdown-menu-w`) to determine which ** way the menu should render from the element triggering it. */ .dropdown-menu { position: absolute; top: 100%; left: 0; z-index: 100; width: 160px; padding-top: var(--control-small-paddingBlock); padding-bottom: var(--control-small-paddingBlock); margin-top: 2px; list-style: none; background-color: var(--overlay-bgColor); background-clip: padding-box; border: var(--borderWidth-thin) solid var(--borderColor-default); border-radius: var(--borderRadius-medium); box-shadow: var(--shadow-floating-large); &::before, &::after { position: absolute; display: inline-block; content: ''; } /* caret border */ &::before { border: 8px solid transparent; border-bottom-color: var(--borderColor-default); } /* caret background (should match dropdown background) */ &::after { border: 7px solid transparent; border-bottom-color: var(--overlay-bgColor); } & > ul { list-style: none; } } .dropdown-menu-no-overflow { width: auto; & .dropdown-item { padding: var(--control-small-paddingBlock) var(--control-medium-paddingInline-spacious); overflow: visible; text-overflow: inherit; } } /* Dropdown items (can be links or buttons) */ .dropdown-item { display: block; padding: var(--control-small-paddingBlock) var(--control-medium-paddingInline-condensed) var(--control-small-paddingBlock) var(--control-medium-paddingInline-spacious); overflow: hidden; color: var(--fgColor-default); text-overflow: ellipsis; white-space: nowrap; &:hover { color: var(--fgColor-onEmphasis); text-decoration: none; background-color: var(--bgColor-accent-emphasis); & > .octicon { color: inherit; opacity: 1; } & [class*='color-fg-'] { color: inherit !important; } & > .Label { color: inherit !important; border-color: currentcolor; } } &.btn-link { width: 100%; text-align: left; } } .dropdown-signout { width: 100%; text-align: left; background: none; border: 0; } .dropdown-divider { display: block; height: 0; margin: var(--stack-gap-condensed) 0; border-top: var(--borderWidth-thin) solid var(--borderColor-default); } .dropdown-header { padding: var(--control-small-paddingBlock) var(--control-medium-paddingInline-spacious); font-size: var(--text-body-size-small); color: var(--fgColor-muted); } .dropdown-item[aria-checked='false'] .octicon-check { display: none; } /* Directional classes ** ** Move the menu and the caret attached to it. Requires at least one of these on ** the `.dropdown-menu` element. */ .dropdown-menu-w { top: 0; right: 100%; left: auto; width: auto; margin-top: 0; margin-right: 8px; &::before { top: 10px; right: -16px; left: auto; border-color: transparent; border-left-color: var(--borderColor-default); } &::after { top: 11px; right: -14px; left: auto; border-color: transparent; border-left-color: var(--overlay-bgColor); } } .dropdown-menu-e { top: 0; left: 100%; width: auto; margin-top: 0; margin-left: 8px; &::before { top: 10px; left: -16px; border-color: transparent; border-right-color: var(--borderColor-default); } &::after { top: 11px; left: -14px; border-color: transparent; border-right-color: var(--overlay-bgColor); } } .dropdown-menu-ne { top: auto; bottom: 100%; left: 0; margin-bottom: 3px; &::before, &::after { top: auto; right: auto; } &::before { bottom: -8px; left: 9px; border-top: 8px solid var(--borderColor-default); border-right: 8px solid transparent; border-bottom: 0; border-left: 8px solid transparent; } &::after { bottom: -7px; left: 10px; border-top: 7px solid var(--overlay-bgColor); border-right: 7px solid transparent; border-bottom: 0; border-left: 7px solid transparent; } } .dropdown-menu-s { right: 50%; left: auto; transform: translateX(50%); &::before { top: -16px; right: 50%; transform: translateX(50%); } &::after { top: -14px; right: 50%; transform: translateX(50%); } } .dropdown-menu-sw { right: 0; left: auto; &::before { top: -16px; right: 9px; left: auto; } &::after { top: -14px; right: 10px; left: auto; } } .dropdown-menu-se { &::before { top: -16px; left: 9px; } &::after { top: -14px; left: 10px; } }