123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- .dropdown {
- @include clearfix();
- position: relative;
- input[type=submit],
- input[type=reset],
- input[type=button],
- button,
- .button {
- padding: 0 5em 0 1em;
- display: block;
- width: 100%;
- height: 3em;
- line-height: 3em;
- text-align: left;
- float: left;
- }
- .action-secondary {
- opacity: 0.8;
- }
- input[type=submit],
- input[type=reset],
- input[type=button],
- button {
- line-height: inherit;
- }
- ul {
- @include unlist();
- background-color: $color-teal;
- position: absolute;
- overflow: hidden;
- top: 100%;
- left: -2000px;
- z-index: 500;
- opacity: 0;
- li {
- float: none;
- border-color: rgba(255, 255, 255, 0.2);
- border-style: solid;
- border-width: 1px 0 0;
- overflow: hidden;
- a:focus,
- button:focus {
- border: 3px solid $color-focus-outline;
- }
- }
- // Media for Windows High Contrast
- @media (forced-colors: $media-forced-colours) {
- li a,
- li button {
- forced-color-adjust: none;
- background-color: $color-black;
- border-color: $color-white;
- color: $color-white;
- }
- li a:focus,
- li button:focus {
- background-color: $color-black;
- forced-color-adjust: none;
- border: 4px solid #0ff;
- color: $color-white;
- }
- }
- a {
- box-sizing: border-box;
- white-space: nowrap;
- position: relative;
- text-decoration: none;
- text-transform: uppercase;
- display: block;
- color: $color-white;
- padding: 1em;
- font-weight: normal;
- &:hover {
- background-color: $color-teal-darker;
- }
- &.icon {
- padding-right: 5em;
- // stylelint-disable-next-line max-nesting-depth
- &:before,
- &:after {
- right: 1em;
- }
- }
- &.shortcut {
- padding-right: 7em;
- }
- }
- a,
- input[type=submit],
- input[type=reset],
- input[type=button],
- .button,
- button {
- border-radius: 0;
- font-size: 0.95em;
- -webkit-font-smoothing: auto;
- }
- label {
- padding: 1.3em;
- }
- .kbd {
- position: absolute;
- right: 1em;
- font-weight: 600;
- font-size: 0.8em;
- color: rgba(0, 0, 0, 0.3);
- }
- }
- &.open ul {
- box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.2);
- opacity: 1;
- left: 0;
- display: block;
- }
- &.match-width ul {
- width: 100%;
- min-width: 110px;
- li {
- white-space: nowrap;
- }
- }
- &.dropup ul {
- box-shadow: 0 -3px 3px 0 rgba(0, 0, 0, 0.2);
- top: auto;
- bottom: 100%;
- li {
- border-width: 0 0 1px;
- }
- }
- .dropdown-toggle {
- color: $color-white;
- text-transform: uppercase;
- background-color: $color-teal;
- line-height: 2.8em;
- cursor: pointer;
- height: 100%;
- border-left: 1px solid rgba(255, 255, 255, 0.2);
- position: absolute;
- right: 0;
- padding: 0 0.5em;
- text-align: center;
- &:before,
- &:after {
- margin: 0;
- }
- &:before {
- width: 1em;
- font-size: 1.2rem;
- }
- &:hover {
- background-color: $color-teal-darker;
- }
- svg.icon { // TODO: remove svg qualifier once the icon font styles are gone
- @include svg-icon(1.3em);
- }
- }
- .bicolor + .dropdown-toggle {
- background-color: $color-teal-darker;
- &:hover {
- background-color: $color-teal-dark;
- }
- }
- &.open .dropdown-toggle {
- background-color: $color-teal-darker;
- }
- .bicolor:hover {
- background-color: $color-teal-dark;
- }
- // Styles for dropdowns which are also buttons e.g page editor
- &.dropdown-button {
- .dropdown-toggle {
- border-radius: 0 3px 3px 0;
- }
- &.open {
- > input[type=button],
- > input[type=submit],
- > button,
- > .button {
- border-radius: 3px 3px 0 0;
- }
- .dropdown-toggle {
- border-radius: 0 3px 0 0;
- }
- }
- }
- &.dropdown-button--white {
- ul {
- background-color: $color-grey-3;
- }
- li a,
- li .button {
- background-color: $color-white;
- color: $color-button;
- border: 0;
- &:hover {
- background-color: $color-grey-4;
- }
- &.no {
- color: $color-button-no;
- }
- &.warning {
- color: $color-button-warning;
- }
- }
- }
- &.dropup.dropdown-button {
- &.open {
- > input[type=button],
- > input[type=submit],
- > button,
- > .button {
- border-radius: 0 0 3px 3px;
- }
- .dropdown-toggle {
- border-radius: 0 0 3px;
- }
- }
- }
- }
- .dropdown.white {
- ul {
- background-color: $color-white;
- li {
- border-top: 1px solid rgba(0, 0, 0, 0.1);
- }
- a {
- color: $color-grey-2;
- &:hover {
- background-color: $color-grey-3;
- }
- }
- }
- }
- .dropdown.warning {
- ul {
- background-color: $color-button-warning;
- }
- .dropdown-toggle {
- background-color: $color-button-warning;
- &:hover {
- background-color: $color-button-warning-hover;
- }
- }
- }
- // Transitions
- .dropdown ul {
- @include transition(opacity 0.2s linear);
- }
- .dropdown-button {
- .button svg.icon { // TODO: leave only class when iconfont styles are removed
- @include svg-icon();
- margin-right: 0.5em;
- }
- }
|