2017-07-18 02:21:45 +08:00
|
|
|
@import "/imports/ui/stylesheets/variables/_all";
|
|
|
|
@import "/imports/ui/stylesheets/mixins/_scrollable";
|
2019-04-08 22:22:22 +08:00
|
|
|
@import "/imports/ui/stylesheets/mixins/_indicators";
|
2016-08-24 03:18:49 +08:00
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
:root {
|
|
|
|
--dropdown-bg: var(--color-white);
|
|
|
|
--dropdown-color: var(--color-text);
|
|
|
|
--caret-shadow-color: var(--color-gray);
|
2016-08-24 03:18:49 +08:00
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
--dropdown-caret-width: 12px;
|
|
|
|
--dropdown-caret-height: 8px;
|
2019-05-15 22:33:29 +08:00
|
|
|
|
|
|
|
--rtl-caret-offset: -0.4375rem;
|
2019-05-17 00:27:43 +08:00
|
|
|
--rtl-content-offset: 10.75rem;
|
2018-10-19 04:37:14 +08:00
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
|
|
|
|
.dropdown {
|
|
|
|
position: relative;
|
2018-04-14 04:34:46 +08:00
|
|
|
|
|
|
|
&:focus {
|
|
|
|
outline: none;
|
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.content {
|
2019-04-08 22:22:22 +08:00
|
|
|
@include highContrastOutline();
|
|
|
|
outline-style: solid;
|
2019-03-12 22:35:19 +08:00
|
|
|
z-index: 9999;
|
2016-09-07 03:10:18 +08:00
|
|
|
position: absolute;
|
2018-10-19 04:37:14 +08:00
|
|
|
background: var(--dropdown-bg);
|
|
|
|
border-radius: var(--border-radius);
|
2016-09-07 03:10:18 +08:00
|
|
|
box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
|
2018-12-22 03:20:15 +08:00
|
|
|
border: 0;
|
2018-10-19 04:37:14 +08:00
|
|
|
padding: calc(var(--line-height-computed) / 2);
|
2016-09-07 03:10:18 +08:00
|
|
|
|
2019-05-16 01:32:45 +08:00
|
|
|
[dir="rtl"] & {
|
|
|
|
right: var(--rtl-content-offset);
|
|
|
|
}
|
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
&:after,
|
|
|
|
&:before {
|
2016-09-07 03:10:18 +08:00
|
|
|
content: '';
|
|
|
|
position: absolute;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&[aria-expanded="false"] {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&[aria-expanded="true"] {
|
|
|
|
display: block;
|
|
|
|
}
|
2017-03-16 02:09:20 +08:00
|
|
|
|
|
|
|
@include mq($small-only) {
|
2017-03-16 22:34:03 +08:00
|
|
|
z-index: 1015;
|
|
|
|
border-radius: 0;
|
|
|
|
background-color: #fff;
|
|
|
|
box-shadow: none;
|
2017-03-16 02:09:20 +08:00
|
|
|
position: fixed;
|
|
|
|
top: 0 !important;
|
|
|
|
left: 0 !important;
|
|
|
|
right: 0 !important;
|
|
|
|
bottom: 0 !important;
|
2017-03-16 22:34:03 +08:00
|
|
|
border: 0 !important;
|
|
|
|
padding: 0 !important;
|
2018-10-19 04:37:14 +08:00
|
|
|
margin: 0 0 calc(var(--line-height-computed) * 5.25) 0 !important;
|
2017-03-16 02:09:20 +08:00
|
|
|
transform: translateX(0) translateY(0) !important;
|
2017-03-16 22:34:03 +08:00
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
&:after,
|
|
|
|
&:before {
|
2017-03-16 22:34:03 +08:00
|
|
|
display: none !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.scrollable {
|
|
|
|
@include mq($small-only) {
|
|
|
|
@include scrollbox-vertical();
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
bottom: 0;
|
2017-03-16 02:09:20 +08:00
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
2016-08-24 03:18:49 +08:00
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
.trigger {
|
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
|
2017-03-16 22:34:03 +08:00
|
|
|
.close {
|
|
|
|
display: none;
|
|
|
|
position: fixed;
|
2018-03-23 04:34:25 +08:00
|
|
|
bottom: 0.8rem;
|
|
|
|
border-radius: 0;
|
2017-03-16 22:34:03 +08:00
|
|
|
z-index: 1011;
|
2018-10-19 04:37:14 +08:00
|
|
|
font-size: calc(var(--font-size-large) * 1.1);
|
|
|
|
width: calc(100% - (var(--line-height-computed) * 2));
|
|
|
|
left: var(--line-height-computed);
|
|
|
|
box-shadow: 0 0 0 2rem var(--color-white) !important;
|
|
|
|
border: var(--color-white) !important;
|
2017-03-16 22:34:03 +08:00
|
|
|
|
|
|
|
@include mq($small-only) {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
|
|
|
|
/* Placements
|
|
|
|
* ==========
|
|
|
|
*/
|
|
|
|
|
|
|
|
%down-caret {
|
|
|
|
bottom: 100%;
|
|
|
|
left: 50%;
|
|
|
|
transform: translateX(-50%);
|
2018-10-19 04:37:14 +08:00
|
|
|
margin-bottom: calc(var(--dropdown-caret-height) * 1.25);
|
2016-09-07 03:10:18 +08:00
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
&:before,
|
|
|
|
&:after {
|
|
|
|
border-left: var(--dropdown-caret-width) solid transparent;
|
|
|
|
border-right: var(--dropdown-caret-width) solid transparent;
|
|
|
|
border-top: var(--dropdown-caret-height) solid var(--dropdown-bg);
|
2016-09-07 03:10:18 +08:00
|
|
|
bottom: 0;
|
2018-10-19 04:37:14 +08:00
|
|
|
margin-bottom: calc(var(--dropdown-caret-height) * -1);
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
2016-09-14 03:47:53 +08:00
|
|
|
|
|
|
|
&:before {
|
2018-10-19 04:37:14 +08:00
|
|
|
border-top: var(--dropdown-caret-height) solid var(--caret-shadow-color);
|
2016-09-14 03:47:53 +08:00
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
%up-caret {
|
|
|
|
top: 100%;
|
|
|
|
left: 50%;
|
|
|
|
transform: translateX(-50%);
|
2018-10-19 04:37:14 +08:00
|
|
|
margin-top: calc(var(--dropdown-caret-height) * 1.25);
|
|
|
|
|
|
|
|
&:before,
|
|
|
|
&:after {
|
|
|
|
border-left: var(--dropdown-caret-width) solid transparent;
|
|
|
|
border-right: var(--dropdown-caret-width) solid transparent;
|
|
|
|
border-bottom: var(--dropdown-caret-height) solid var(--dropdown-bg);
|
|
|
|
margin-top: calc(var(--dropdown-caret-height) * -1);
|
2016-09-07 03:10:18 +08:00
|
|
|
top: 0;
|
2019-05-14 21:15:54 +08:00
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
right: 50%;
|
|
|
|
transform: translateX(-150%);
|
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
2016-09-14 03:47:53 +08:00
|
|
|
|
|
|
|
&:before {
|
2018-10-19 04:37:14 +08:00
|
|
|
border-bottom: var(--dropdown-caret-height) solid var(--caret-shadow-color);
|
2016-09-14 03:47:53 +08:00
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
%right-caret {
|
|
|
|
top: 50%;
|
|
|
|
transform: translateX(-100%) translateY(-50%);
|
2018-10-19 04:37:14 +08:00
|
|
|
left: calc(var(--dropdown-caret-height) * -1.25);
|
|
|
|
|
|
|
|
&:before,
|
|
|
|
&:after {
|
|
|
|
border-top: var(--dropdown-caret-width) solid transparent;
|
|
|
|
border-bottom: var(--dropdown-caret-width) solid transparent;
|
|
|
|
border-left: var(--dropdown-caret-height) solid var(--dropdown-bg);
|
|
|
|
margin-right: calc(var(--dropdown-caret-height) * -1);
|
2016-09-07 03:10:18 +08:00
|
|
|
top: 50%;
|
|
|
|
right: 0;
|
2019-05-14 21:15:54 +08:00
|
|
|
|
|
|
|
[dir="rtl"] & {
|
2019-05-15 22:33:29 +08:00
|
|
|
left: 0;
|
|
|
|
border-left: 0;
|
2019-05-14 21:15:54 +08:00
|
|
|
border-right: var(--dropdown-caret-height) solid var(--dropdown-bg);
|
|
|
|
margin-left: calc(var(--dropdown-caret-height) * -1);
|
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
2016-09-14 03:47:53 +08:00
|
|
|
|
|
|
|
&:before {
|
2019-05-15 22:33:29 +08:00
|
|
|
|
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
border-left: var(--dropdown-caret-height) solid var(--caret-shadow-color);
|
2019-05-14 21:15:54 +08:00
|
|
|
border-right: 0;
|
|
|
|
|
|
|
|
[dir="rtl"] & {
|
2019-05-15 22:33:29 +08:00
|
|
|
transform: rotate(180deg);
|
2019-05-14 21:15:54 +08:00
|
|
|
border-left: 0;
|
|
|
|
border-right: var(--dropdown-caret-height) solid var(--caret-shadow-color);
|
|
|
|
}
|
2016-09-14 03:47:53 +08:00
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
%left-caret {
|
|
|
|
top: 50%;
|
|
|
|
transform: translateX(100%) translateY(-50%);
|
2018-10-19 04:37:14 +08:00
|
|
|
right: calc(var(--dropdown-caret-height) * -1.25);
|
|
|
|
|
|
|
|
&:before,
|
|
|
|
&:after {
|
|
|
|
border-top: var(--dropdown-caret-width) solid transparent;
|
|
|
|
border-bottom: var(--dropdown-caret-width) solid transparent;
|
|
|
|
border-right: var(--dropdown-caret-height) solid var(--dropdown-bg);
|
|
|
|
margin-left: calc(var(--dropdown-caret-height) * -1);
|
2016-09-07 03:10:18 +08:00
|
|
|
top: 50%;
|
|
|
|
left: 0;
|
2019-05-14 21:15:54 +08:00
|
|
|
|
|
|
|
[dir="rtl"] & {
|
2019-05-15 22:33:29 +08:00
|
|
|
transform: rotate(180deg);
|
2019-05-14 21:15:54 +08:00
|
|
|
margin-right: calc(var(--dropdown-caret-height) * -1);
|
2019-05-16 00:10:50 +08:00
|
|
|
right: 1px;
|
2019-05-14 21:15:54 +08:00
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
2016-09-14 03:47:53 +08:00
|
|
|
|
|
|
|
&:before {
|
2018-10-19 04:37:14 +08:00
|
|
|
border-right: var(--dropdown-caret-height) solid var(--caret-shadow-color);
|
2019-05-14 21:15:54 +08:00
|
|
|
border-left: 0;
|
2019-05-15 22:33:29 +08:00
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
[dir="rtl"] & {
|
2019-05-15 22:33:29 +08:00
|
|
|
right: var(--rtl-caret-offset);
|
|
|
|
border: none;
|
|
|
|
margin: 0;
|
2019-05-14 21:15:54 +08:00
|
|
|
}
|
2016-09-14 03:47:53 +08:00
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
%horz-center-caret {
|
2018-10-19 04:37:14 +08:00
|
|
|
&:after,
|
|
|
|
&:before {
|
2017-11-17 19:52:48 +08:00
|
|
|
left: 50%;
|
2018-10-19 04:37:14 +08:00
|
|
|
margin-left: calc(var(--dropdown-caret-width) * -1);
|
2019-05-14 21:15:54 +08:00
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
margin-right: calc(var(--dropdown-caret-width) * -1);
|
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
%horz-left-caret {
|
|
|
|
transform: translateX(-100%);
|
|
|
|
left: 100%;
|
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
[dir="rtl"] & {
|
|
|
|
right: 100%;
|
|
|
|
}
|
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
&:after,
|
|
|
|
&:before {
|
|
|
|
right: calc(var(--dropdown-caret-width) / 2);
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
%horz-right-caret {
|
|
|
|
transform: translateX(100%);
|
|
|
|
right: 100%;
|
|
|
|
left: auto;
|
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
&:after,
|
|
|
|
&:before {
|
2018-11-27 23:53:30 +08:00
|
|
|
left: var(--dropdown-caret-width);
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
%vert-center-caret {
|
2018-10-19 04:37:14 +08:00
|
|
|
&:after,
|
|
|
|
&:before {
|
|
|
|
margin-top: calc(var(--dropdown-caret-width) * -1);
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
%vert-top-caret {
|
|
|
|
top: 0;
|
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
&:after,
|
|
|
|
&:before {
|
2016-09-07 03:10:18 +08:00
|
|
|
top: 0;
|
2018-10-19 04:37:14 +08:00
|
|
|
margin-top: calc(var(--dropdown-caret-width) / 2);
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
%vert-bottom-caret {
|
|
|
|
top: auto;
|
|
|
|
bottom: 0;
|
|
|
|
|
2018-10-19 04:37:14 +08:00
|
|
|
&:after,
|
|
|
|
&:before {
|
2016-09-07 03:10:18 +08:00
|
|
|
top: auto;
|
2018-10-19 04:37:14 +08:00
|
|
|
bottom: calc(var(--dropdown-caret-width) / 2);
|
2019-05-14 21:15:54 +08:00
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
top: calc(var(--dropdown-caret-width) / 2);
|
|
|
|
bottom: auto;
|
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.top {
|
|
|
|
@extend %down-caret;
|
|
|
|
@extend %horz-center-caret;
|
|
|
|
}
|
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
.top-left, [dir="rtl"] .top-right {
|
2016-09-07 03:10:18 +08:00
|
|
|
@extend %down-caret;
|
|
|
|
@extend %horz-right-caret;
|
2018-07-11 01:01:17 +08:00
|
|
|
min-width: 11.5rem;
|
|
|
|
|
|
|
|
@include mq($small-only) {
|
|
|
|
width: auto;
|
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.top-right {
|
|
|
|
@extend %down-caret;
|
|
|
|
@extend %horz-left-caret;
|
|
|
|
}
|
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
[dir="rtl"] .top-left {
|
|
|
|
@extend %down-caret;
|
|
|
|
@extend %horz-left-caret;
|
|
|
|
transform: translateX(25%);
|
|
|
|
}
|
|
|
|
|
2016-09-07 03:10:18 +08:00
|
|
|
.bottom {
|
|
|
|
@extend %up-caret;
|
|
|
|
@extend %horz-center-caret;
|
|
|
|
}
|
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
.bottom-left, [dir="rtl"] .bottom-right {
|
2016-09-07 03:10:18 +08:00
|
|
|
@extend %up-caret;
|
|
|
|
@extend %horz-right-caret;
|
|
|
|
}
|
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
.bottom-right, [dir="rtl"] .bottom-left {
|
2016-09-07 03:10:18 +08:00
|
|
|
@extend %up-caret;
|
|
|
|
@extend %horz-left-caret;
|
2019-05-02 04:02:34 +08:00
|
|
|
min-width: 10rem;
|
2018-07-11 01:01:17 +08:00
|
|
|
|
|
|
|
@include mq($small-only) {
|
|
|
|
width: auto;
|
|
|
|
}
|
2016-09-07 03:10:18 +08:00
|
|
|
}
|
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
.left, [dir="rtl"] .right {
|
2016-09-07 03:10:18 +08:00
|
|
|
@extend %right-caret;
|
|
|
|
@extend %vert-center-caret;
|
|
|
|
}
|
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
.left-top, [dir="rtl"] .right-top {
|
2016-09-07 03:10:18 +08:00
|
|
|
@extend %right-caret;
|
|
|
|
@extend %vert-top-caret;
|
|
|
|
transform: translateX(-100%) translateY(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
.left-bottom {
|
|
|
|
@extend %right-caret;
|
|
|
|
@extend %vert-bottom-caret;
|
|
|
|
transform: translateX(-100%) translateY(0);
|
|
|
|
}
|
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
[dir="rtl"] .right-bottom {
|
|
|
|
@extend %right-caret;
|
|
|
|
@extend %vert-bottom-caret;
|
|
|
|
transform: translateX(-110%) translateY(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
.right, [dir="rtl"] .left {
|
2016-09-07 03:10:18 +08:00
|
|
|
@extend %left-caret;
|
|
|
|
@extend %vert-center-caret;
|
|
|
|
}
|
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
.right-top {
|
2016-09-07 03:10:18 +08:00
|
|
|
@extend %left-caret;
|
|
|
|
@extend %vert-top-caret;
|
|
|
|
transform: translateX(100%) translateY(0);
|
|
|
|
}
|
|
|
|
|
2019-05-14 21:15:54 +08:00
|
|
|
[dir="rtl"] .right-top {
|
|
|
|
transform: translateX(-25%) translateY(0%);
|
|
|
|
}
|
|
|
|
|
|
|
|
[dir="rtl"] .left-top {
|
|
|
|
@extend %left-caret;
|
|
|
|
@extend %vert-top-caret;
|
|
|
|
transform: translateX(125%) translateY(-25%);
|
|
|
|
}
|
|
|
|
|
|
|
|
.right-bottom, [dir="rtl"] .left-bottom {
|
2016-09-07 03:10:18 +08:00
|
|
|
@extend %left-caret;
|
|
|
|
@extend %vert-bottom-caret;
|
|
|
|
transform: translateX(100%) translateY(0);
|
|
|
|
}
|