UNPKG

@atlassian/aui

Version:

Atlassian User Interface Framework

437 lines (434 loc) 13.8 kB
/*!! * @atlassian/aui - Atlassian User Interface Framework * @version v8.0.0-alpha.1 * @link https://aui.atlassian.com * @license SEE LICENSE IN LICENSE.md * @author Atlassian Pty Ltd. */ /** * Dropdown 2 */ /* Functional styles - these are always applied ---------------------------------------------------------------------- */ .aui-dropdown2 { box-sizing: border-box; max-width: 300px; min-width: 160px; position: absolute; } .aui-dropdown2[aria-hidden="true"] { top: -999em; left: -999em; } .aui-dropdown2:not([resolved]) { display: none; } .aui-dropdown2 [role="menuitem"], .aui-dropdown2 [role="menuitemcheckbox"], .aui-dropdown2 [role="menuitemradio"], .aui-dropdown2 [role="radio"], .aui-dropdown2 [role="checkbox"], .aui-dropdown2 a { -ms-user-select: none; -moz-user-select: none; -webkit-user-select: none; user-select: none; box-sizing: content-box; display: block; line-height: 1.14285714; padding: 7px 10px; } .aui-dropdown2 [role="menuitem"] :focus, .aui-dropdown2 [role="menuitemcheckbox"] :focus, .aui-dropdown2 [role="menuitemradio"] :focus, .aui-dropdown2 [role="radio"] :focus, .aui-dropdown2 [role="checkbox"] :focus, .aui-dropdown2 a :focus { z-index: 1; } .aui-dropdown2 .aui-list-truncate [role="menuitem"], .aui-dropdown2 .aui-list-truncate [role="menuitemcheckbox"], .aui-dropdown2 .aui-list-truncate [role="menuitemradio"], .aui-dropdown2 .aui-list-truncate [role="radio"], .aui-dropdown2 .aui-list-truncate [role="checkbox"], .aui-dropdown2 .aui-list-truncate a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* Default style for Dropdown2, invoked with aui-style-default ---------------------------------------------------------------------- */ .aui-dropdown2.aui-style-default { box-shadow: 0 4px 8px -2px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31); background: #FFFFFF; border: 0 solid #DFE1E6; border-radius: 3px; color: #344563; padding: 3px 0; } @media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { .aui-dropdown2.aui-style-default { box-shadow: 0 4px 8px -2px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.13), 1px 0 1px rgba(9, 30, 66, 0.13), -1px 0 1px rgba(9, 30, 66, 0.13), 0 -1px 1px rgba(9, 30, 66, 0.13); } } .aui-dropdown2.aui-style-default ul { list-style: none; margin: 0; padding-left: 0; } .aui-dropdown2.aui-style-default .aui-dropdown2-section { margin-top: 3px; } .aui-dropdown2.aui-style-default .aui-dropdown2-section:first-child { margin-top: 0; } .aui-dropdown2.aui-style-default .aui-dropdown2-section + .aui-dropdown2-section { border-top: 1px solid #DFE1E6; padding-top: 3px; } .aui-dropdown2.aui-style-default > strong, .aui-dropdown2.aui-style-default .aui-dropdown2-section > strong, .aui-dropdown2-heading { color: #6B778C; font-size: 11px; font-weight: 600; line-height: 1.45454545; letter-spacing: 0; text-transform: uppercase; display: block; padding: 7px 10px; } .aui-dropdown2-heading > strong { font-size: inherit; font-weight: inherit; line-height: inherit; } .aui-dropdown2.aui-style-default strong + ul { margin-top: 0; } .aui-dropdown2.aui-style-default { /* If not hovering on the dropdown, the "hover" style is best for whatever has browser focus. */ /* Set disabled styles last, so that the cascade gives them a higher precedence. */ } .aui-dropdown2.aui-style-default [role="menuitem"], .aui-dropdown2.aui-style-default [role="menuitemcheckbox"], .aui-dropdown2.aui-style-default [role="menuitemradio"], .aui-dropdown2.aui-style-default [role="radio"], .aui-dropdown2.aui-style-default [role="checkbox"], .aui-dropdown2.aui-style-default a { background-color: transparent; color: #344563; text-decoration: none; cursor: pointer; } .aui-dropdown2.aui-style-default:hover { /* * When a user hovers over the dropdown with the mouse, we set all but the hovered item to inactive display. * If the user pressed 'enter' while this was happening, it wouldn't activate what was behind the cursor, * but the likelihood of a mixed-mode user is fairly low. The only way to remedy this would be to set * the document's active element to whatever is behind the mouse... but that has its own problems, such as * unintentionally changing the selected item when the screen or dropdown content scrolls behind the mouse. * This styling choice seems to be the best compromise. */ } .aui-dropdown2.aui-style-default:hover .aui-dropdown2-checkbox, .aui-dropdown2.aui-style-default:hover .aui-dropdown2-radio, .aui-dropdown2.aui-style-default:hover a { background-color: transparent; color: #344563; text-decoration: none; cursor: pointer; } .aui-dropdown2.aui-style-default:hover .aui-dropdown2-checkbox:not(.aui-dropdown2-disabled):hover, .aui-dropdown2.aui-style-default:hover .aui-dropdown2-radio:not(.aui-dropdown2-disabled):hover, .aui-dropdown2.aui-style-default:hover a:not(.aui-dropdown2-disabled):hover { background-color: #EBECF0; color: #344563; } .aui-dropdown2.aui-style-default:hover .aui-dropdown2-checkbox:not(.aui-dropdown2-disabled):active, .aui-dropdown2.aui-style-default:hover .aui-dropdown2-radio:not(.aui-dropdown2-disabled):active, .aui-dropdown2.aui-style-default:hover a:not(.aui-dropdown2-disabled):active { background-color: #DEEBFF; color: #0052CC; } .aui-dropdown2.aui-style-default .active, .aui-dropdown2.aui-style-default .aui-dropdown2-active { background-color: #EBECF0; color: #344563; } .aui-dropdown2.aui-style-default:hover .aui-dropdown2-disabled, .aui-dropdown2.aui-style-default .aui-dropdown2-disabled, .aui-dropdown2.aui-style-default [aria-disabled="true"], .aui-dropdown2.aui-style-default a.disabled { background-color: transparent; color: #7A869A; cursor: not-allowed; text-decoration: none; } .aui-dropdown2.aui-style-default .aui-icon-container, .aui-dropdown2.aui-style-default .aui-dropdown2-radio, .aui-dropdown2.aui-style-default .aui-dropdown2-checkbox { padding-left: 35px; background-position: 10px 7px; background-repeat: no-repeat; position: relative; } .aui-dropdown2.aui-style-default .aui-icon-container > img, .aui-dropdown2.aui-style-default .aui-icon-container > .aui-icon, .aui-dropdown2.aui-style-default .aui-icon-container > .aui-avatar { border-width: 0; display: inline-block; left: 10px; overflow: hidden; position: absolute; top: 7px; } /* Checkbox items */ .aui-dropdown2.aui-style-default .aui-dropdown2-checkbox.aui-dropdown2-checked::before { -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; -webkit-text-stroke-width: 0; font-family: "Adgs Icons"; font-weight: normal; font-style: normal; speak: none; color: inherit; content: "\F194"; font-size: 16px; height: 16px; left: 0; line-height: 1; margin-top: -8px; position: absolute; text-indent: 0; top: 50%; width: 16px; margin-left: 8px; } /* Radio items */ .aui-dropdown2.aui-style-default .aui-dropdown2-radio.aui-dropdown2-checked::before { -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; -webkit-text-stroke-width: 0; font-family: "Adgs Icons"; font-weight: normal; font-style: normal; speak: none; color: inherit; content: "\F500"; font-size: 16px; height: 16px; left: 0; line-height: 1; margin-top: -8px; position: absolute; text-indent: 0; top: 50%; width: 16px; margin-left: 8px; } /* Tailed dropdown variant */ .aui-dropdown2.aui-dropdown2-tailed::before, .aui-dropdown2.aui-dropdown2-tailed::after { border-color: transparent; border-style: outset outset solid outset; border-width: 8px; bottom: 100%; content: ""; display: block; height: 0; position: absolute; width: 0; } .aui-dropdown2.aui-dropdown2-tailed::before { border-bottom-color: #DFE1E6; margin-bottom: 1px; } .aui-dropdown2.aui-dropdown2-tailed::after { border-bottom-color: #FFFFFF; } /* Arrow for sub menus */ .aui-dropdown2-sub-trigger { position: relative; } .aui-dropdown2-sub-trigger::before { -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; -webkit-text-stroke-width: 0; font-family: "Adgs Icons"; font-weight: normal; font-style: normal; speak: none; color: inherit; content: "\F11C"; font-size: 16px; height: 16px; left: 0; line-height: 1; margin-top: -8px; position: absolute; text-indent: 0; top: 50%; width: 16px; left: 100%; margin-left: -24px; } .aui-dropdown2-trigger:not(.aui-dropdown2-trigger-arrowless) { padding-right: 24px !important; position: relative; } /* Dropdown2 button integration ---------- */ .aui-button-link.aui-dropdown2-trigger.active:first-child, .aui-button-link.aui-dropdown2-trigger.active, .aui-button-text.aui-dropdown2-trigger.active:first-child, .aui-button-text.aui-dropdown2-trigger.active { box-shadow: none; } .aui-buttons .aui-button.aui-button-subtle.aui-dropdown2-trigger.active, .aui-button.aui-button-subtle.aui-dropdown2-trigger.active { border-color: transparent; } .aui-button.aui-button-subtle.aui-dropdown2-trigger:hover { border-color: transparent; } /* Compact Dropdown2 Trigger */ .aui-button.aui-button-compact.aui-dropdown2-trigger:not(.aui-dropdown2-trigger-arrowless) { padding-right: 21px !important; /* 8px (arrow width) + 8px (right padding) + 5 (margin between arrow and logo) */ } .aui-button.aui-button-compact.aui-dropdown2-trigger::after { margin-left: -16px; /* Override the margin-left from below for to compensate for the smaller padding-right */ } /* adjust padding for smaller height */ .aui-button.aui-dropdown2-trigger.aui-button-compact.active:first-child:not(.aui-dropdown2-trigger-arrowless), .aui-button.aui-dropdown2-trigger.aui-button-compact.active:not(.aui-dropdown2-trigger-arrowless) { padding-bottom: 3px; /* increase the padding to cater for the lack of border so the button doesn't change size */ } /* End Compact Dropdown2 Trigger */ .aui-button.aui-dropdown2-trigger:not(.aui-dropdown2-trigger-arrowless)::after { -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; -webkit-text-stroke-width: 0; font-family: "Adgs Icons"; font-weight: normal; font-style: normal; speak: none; content: "\F15B"; font-size: 16px; height: 16px; line-height: 1; margin-top: -8px; position: absolute; right: 4px; top: 50%; text-indent: 0; width: 16px; } /* suppress old icon pattern for dropdown widget so we don't get double arrows */ .aui-button.aui-dropdown2-trigger > .icon-dropdown, .aui-button.aui-dropdown2-trigger > .aui-icon-dropdown { display: none; } /* INPUT does not play with ::after - dropdown2 does not support arrow styles for INPUT buttons */ /* We cannot position arrows on aui-button-text because we don't know what size they will be all the time */ input.aui-button.aui-dropdown2-trigger, .aui-button.aui-button-text.aui-dropdown2-trigger { padding-right: 10px !important; /* someone used important now we're all doomed */ } input.aui-button.aui-dropdown2-trigger::after, .aui-button.aui-button-text.aui-dropdown2-trigger::after { display: none; } /* Dropdown2-only / Split Button ---------- */ .aui-buttons .aui-button.aui-button-split-more.aui-dropdown2-trigger, .aui-buttons .aui-button.aui-button-split-more.aui-dropdown2-trigger.active { /* don't touch vertical padding or things jump around, jump around, jump up jump up and get down */ padding-left: 0; padding-right: 0; width: 24px; text-indent: -9999em; overflow: hidden; } .aui-buttons .aui-button.aui-button-split-more.aui-dropdown2-trigger::after, .aui-buttons .aui-button.aui-button-split-more.aui-dropdown2-trigger.active::after { content: "\F17F"; } /** * Dropdown2 triggers in header */ .aui-header .aui-dropdown2-trigger.active, .aui-header a:focus, .aui-header a:hover, .aui-header a:active { color: #DEEBFF; background-color: rgba(9, 30, 66, 0.48); } /* In case showIcon is not set to false for header dropdown triggers */ .aui-header .aui-dropdown2-trigger .aui-icon-dropdown { display: none; } /* Styling the dropdown2 triggers differently in the header to avoid inline-block spacing issues with other icons */ .aui-header .aui-dropdown2-trigger:not(.aui-dropdown2-trigger-arrowless)::after { -moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased; -webkit-text-stroke-width: 0; font-family: "Adgs Icons"; font-weight: normal; font-style: normal; speak: none; content: "\F15B"; font-size: 16px; height: 16px; line-height: 1; margin-top: -8px; position: absolute; right: 4px; top: 50%; text-indent: 0; width: 16px; } /* Dropdown2 layer integration */ .aui-dropdown2.aui-layer { -webkit-height: auto; height: auto; } .aui-dropdown2.aui-layer.aui-style-default.aui-alignment-element-attached-top { margin-top: 3px; } .aui-dropdown2.aui-layer.aui-style-default.aui-alignment-element-attached-top.aui-dropdown2-tailed { margin-top: 11px; } .aui-dropdown2.aui-layer.aui-style-default.aui-alignment-side-submenu { margin-top: -3px; } /** * Dropdown2 web components */ aui-dropdown-menu, aui-dropdown-group, aui-section, aui-item-checkbox, aui-item-radio, aui-item-link { display: block; } aui-dropdown-menu.aui-dropdown2 .aui-dropdown2-heading:empty, aui-dropdown-menu.aui-dropdown2 .aui-style-default .aui-dropdown2-section > strong:empty, aui-dropdown-menu.aui-dropdown2 .aui-dropdown2.aui-style-default > strong:empty { display: none; } aui-dropdown-menu:not([resolved]) { display: none; } aui-dropdown-menu .aui-dropdown-loading { padding: 5px; } aui-dropdown-menu .aui-dropdown-loading aui-spinner { display: inline-block; vertical-align: bottom; }