0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 17:36:49 +01:00
wagtail/client/scss/components/_dropdown.legacy.scss

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

357 lines
6.7 KiB
SCSS
Raw Normal View History

.dropdown {
@include clearfix();
2015-11-03 13:15:33 +01:00
position: relative;
input[type='submit'],
input[type='reset'],
input[type='button'],
button,
2015-11-02 15:39:36 +01:00
.button {
2020-06-15 13:03:12 +02:00
padding: 0 5em 0 1em;
display: block;
width: 100%;
height: 3em;
line-height: 3em;
text-align: start;
float: left;
}
.action-secondary {
opacity: 0.8;
}
input[type='submit'],
input[type='reset'],
2015-11-02 15:39:36 +01:00
input[type='button'],
button {
line-height: inherit;
}
ul {
@include unlist();
background-color: $color-teal;
position: absolute;
overflow: hidden;
top: 100%;
// Remove once we drop support for Safari 13.
// stylelint-disable-next-line property-disallowed-list
left: -2000px;
inset-inline-start: -2000px;
z-index: 500;
opacity: 0;
li {
float: none;
2015-11-03 13:15:33 +01:00
border-color: rgba(255, 255, 255, 0.2);
2014-05-08 15:26:32 +02:00
border-style: solid;
2015-11-03 13:15:33 +01:00
border-width: 1px 0 0;
overflow: hidden;
a:focus,
button:focus {
border: 3px solid $color-focus-outline;
}
}
2015-11-03 13:15:33 +01:00
// Media for Windows High Contrast
@media (forced-colors: $media-forced-colours) {
li {
border-width: 1px;
}
li:hover {
border-color: Highlight;
}
li a,
li button {
forced-color-adjust: none;
background-color: $color-black;
border-color: $color-white;
color: $color-white;
}
li a:focus,
2015-11-02 15:39:36 +01:00
li button:focus {
background-color: $color-black;
forced-color-adjust: none;
border: 4px solid #0ff;
color: $color-white;
}
}
a {
2014-05-08 15:26:32 +02:00
box-sizing: border-box;
white-space: nowrap;
position: relative;
text-decoration: none;
display: block;
color: $color-white;
padding: 1em;
font-weight: normal;
&:hover {
background-color: $color-teal-darker;
}
&.icon {
padding-inline-end: 5em;
// stylelint-disable-next-line max-nesting-depth
&:before,
&:after {
// Remove once we drop support for Safari 13.
// stylelint-disable-next-line property-disallowed-list
right: 1em;
inset-inline-end: 1em;
}
}
&.shortcut {
padding-inline-end: 7em;
}
}
a,
input[type='submit'],
input[type='reset'],
input[type='button'],
.button,
button {
2015-11-27 11:20:59 +01:00
border-radius: 0;
font-size: 0.95em;
-webkit-font-smoothing: auto;
}
label {
padding: 1.3em;
}
.kbd {
position: absolute;
// Remove once we drop support for Safari 13.
// stylelint-disable-next-line property-disallowed-list
right: 1em;
inset-inline-end: 1em;
font-weight: 600;
2015-11-27 11:20:59 +01:00
font-size: 0.8em;
color: rgba(0, 0, 0, 0.3);
}
}
&.open ul {
2015-11-03 13:15:33 +01:00
box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.2);
opacity: 1;
// Remove once we drop support for Safari 13.
// stylelint-disable-next-line property-disallowed-list
left: 0;
inset-inline-start: 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%;
2020-06-15 13:03:12 +02:00
li {
2020-06-15 13:03:12 +02:00
border-width: 0 0 1px;
}
}
2020-06-15 13:03:12 +02:00
.dropdown-toggle {
color: $color-white;
background-color: $color-teal;
2020-06-15 13:03:12 +02:00
line-height: 2.8em;
cursor: pointer;
height: 100%;
border-inline-start: 1px solid rgba(255, 255, 255, 0.2);
2020-06-15 13:03:12 +02:00
position: absolute;
// Remove once we drop support for Safari 13.
// stylelint-disable-next-line property-disallowed-list
right: 0;
inset-inline-end: 0;
padding: 0 0.5em;
2020-06-15 13:03:12 +02:00
text-align: center;
2020-06-15 13:03:12 +02:00
&: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);
}
}
2015-11-03 13:15:33 +01:00
.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 {
// Media for Windows High Contrast
@media (forced-colors: $media-forced-colours) {
button {
border-color: ActiveText;
}
button:hover {
border-color: Highlight;
}
a.button.bicolor.button:hover {
border-color: Highlight;
}
}
.dropdown-toggle {
border-radius: 0 3px 3px 0;
// Media for Windows High Contrast
@media (forced-colors: $media-forced-colours) {
background: transparent;
box-sizing: border-box;
border: 1px solid ActiveText;
}
}
2015-11-03 13:15:33 +01:00
.dropdown-toggle:hover {
// Media for Windows High Contrast
@media (forced-colors: $media-forced-colours) {
background-color: transparent;
border: 1px solid Highlight;
2014-05-08 15:26:32 +02:00
}
}
&.open {
> input[type='button'],
> input[type='submit'],
> button,
2015-11-03 13:15:33 +01:00
> .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;
}
2016-02-17 15:54:54 +01:00
&.warning {
color: $color-button-warning;
}
}
}
&.dropup.dropdown-button {
&.open {
2015-11-03 13:15:33 +01:00
> input[type='button'],
> input[type='submit'],
> button,
2015-11-03 13:15:33 +01:00
> .button {
border-radius: 0 0 3px 3px;
}
.dropdown-toggle {
2015-11-27 11:20:59 +01:00
border-radius: 0 0 3px;
}
}
}
}
.dropdown.white {
ul {
2015-11-03 13:15:33 +01:00
background-color: $color-white;
li {
2015-11-03 13:15:33 +01:00
border-top: 1px solid rgba(0, 0, 0, 0.1);
}
a {
color: $color-grey-2;
&:hover {
background-color: $color-grey-3;
}
}
}
}
2016-02-17 15:54:54 +01:00
.dropdown.warning {
ul {
background-color: $color-button-warning;
}
.dropdown-toggle {
background-color: $color-button-warning;
&:hover {
background-color: $color-button-warning-hover;
}
}
2016-02-17 15:54:54 +01:00
}
2015-11-03 13:15:33 +01:00
// Transitions
// stylelint-disable-next-line no-duplicate-selectors
.dropdown ul {
@include transition(opacity 0.2s linear);
2015-11-03 13:15:33 +01:00
}
.dropdown-button {
.button svg.icon {
// TODO: leave only class when iconfont styles are removed
@include svg-icon();
margin-inline-end: 0.5em;
}
}