2019-12-08 00:32:00 +05:30
|
|
|
@import '~app/components/ui/colors.scss';
|
|
|
|
@import '~app/components/ui/fonts.scss';
|
2016-05-26 03:07:18 +05:30
|
|
|
|
|
|
|
$dropdownPadding: 15px;
|
|
|
|
|
|
|
|
@mixin dropdown-theme($themeName, $backgroundColor) {
|
2020-05-24 04:38:24 +05:30
|
|
|
.#{$themeName} {
|
|
|
|
composes: dropdown;
|
2016-05-26 03:07:18 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
background-color: $backgroundColor;
|
2016-05-26 03:07:18 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
.menuItem:hover,
|
|
|
|
&:hover {
|
|
|
|
background-color: lighter($backgroundColor);
|
|
|
|
}
|
2016-05-26 03:07:18 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
&:active,
|
|
|
|
&.opened {
|
|
|
|
background-color: darker($backgroundColor);
|
|
|
|
}
|
2016-05-26 03:07:18 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown {
|
2020-05-24 04:38:24 +05:30
|
|
|
display: inline-block;
|
|
|
|
box-sizing: border-box;
|
|
|
|
height: 50px;
|
2021-03-26 08:49:04 +05:30
|
|
|
padding-inline-start: $dropdownPadding;
|
2020-05-24 04:38:24 +05:30
|
|
|
// 28px - ширина иконки при заданном размере шрифта
|
2021-03-26 08:49:04 +05:30
|
|
|
padding-inline-end: $dropdownPadding * 2 + 28px;
|
2020-05-24 04:38:24 +05:30
|
|
|
position: relative;
|
|
|
|
|
|
|
|
font-family: $font-family-title;
|
|
|
|
color: $defaultButtonTextColor;
|
|
|
|
font-size: 18px;
|
|
|
|
line-height: 50px;
|
|
|
|
text-decoration: none;
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
transition: background-color 0.25s;
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
outline: none;
|
|
|
|
}
|
2016-05-26 03:07:18 +05:30
|
|
|
}
|
|
|
|
|
2016-06-18 21:12:07 +05:30
|
|
|
.label {
|
2020-05-24 04:38:24 +05:30
|
|
|
display: block;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
2021-03-26 08:49:04 +05:30
|
|
|
text-align: start;
|
2016-06-18 21:12:07 +05:30
|
|
|
}
|
|
|
|
|
2016-05-29 22:18:30 +05:30
|
|
|
.opened {
|
|
|
|
}
|
|
|
|
|
2016-05-26 03:07:18 +05:30
|
|
|
.toggleIcon {
|
2020-05-24 04:38:24 +05:30
|
|
|
composes: selecter from '~app/components/ui/icons.scss';
|
|
|
|
|
|
|
|
position: absolute;
|
2021-03-26 08:49:04 +05:30
|
|
|
inset-inline-end: $dropdownPadding;
|
2020-05-24 04:38:24 +05:30
|
|
|
top: 16px;
|
|
|
|
font-size: 17px;
|
2021-03-26 08:49:04 +05:30
|
|
|
transition: inset-inline-end 0.3s cubic-bezier(0.23, 1, 0.32, 1); // easeOutQuint
|
|
|
|
// TODO: right now transition property doesn't support the bidirectional value.
|
|
|
|
// See https://github.com/gasolin/postcss-bidirection/issues/25.
|
|
|
|
// noinspection CssOverwrittenProperties Graceful degradation
|
|
|
|
transition: right 0.3s cubic-bezier(0.23, 1, 0.32, 1);
|
|
|
|
|
|
|
|
html[dir='rtl'] & {
|
|
|
|
transition: left 0.3s cubic-bezier(0.23, 1, 0.32, 1);
|
|
|
|
}
|
2020-05-24 04:38:24 +05:30
|
|
|
|
|
|
|
.dropdown:hover & {
|
2021-03-26 08:49:04 +05:30
|
|
|
inset-inline-end: $dropdownPadding - 5px;
|
2020-05-24 04:38:24 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown:active &,
|
|
|
|
.dropdown.opened & {
|
2021-03-26 08:49:04 +05:30
|
|
|
inset-inline-end: $dropdownPadding + 5px;
|
2020-05-24 04:38:24 +05:30
|
|
|
}
|
2016-05-26 03:07:18 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
.block {
|
2020-05-24 04:38:24 +05:30
|
|
|
display: block;
|
2019-11-27 14:33:32 +05:30
|
|
|
width: 100%;
|
2020-05-24 04:38:24 +05:30
|
|
|
|
|
|
|
.menu {
|
|
|
|
width: 100%;
|
|
|
|
}
|
2016-05-28 04:44:28 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
.menu {
|
2020-05-24 04:38:24 +05:30
|
|
|
position: absolute;
|
|
|
|
top: 60px;
|
2021-03-26 08:49:04 +05:30
|
|
|
inset-inline-start: 0;
|
2020-05-24 04:38:24 +05:30
|
|
|
z-index: 10;
|
2016-05-28 04:44:28 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
width: 120%;
|
2016-05-28 04:44:28 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
background: #fff;
|
|
|
|
border: 1px solid #ddd;
|
2016-05-28 04:44:28 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
transition: 0.5s ease;
|
|
|
|
transition-property: opacity, visibility;
|
|
|
|
opacity: 0;
|
|
|
|
visibility: hidden;
|
2016-05-28 04:44:28 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
.dropdown.opened & {
|
|
|
|
opacity: 1;
|
|
|
|
visibility: visible;
|
|
|
|
}
|
2016-05-28 04:44:28 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
.menuItem {
|
2020-05-24 04:38:24 +05:30
|
|
|
composes: label;
|
2016-06-18 21:12:07 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
height: 50px;
|
|
|
|
padding: 0 13px;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
2016-05-28 04:44:28 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
color: #444;
|
|
|
|
line-height: 50px;
|
|
|
|
font-size: 18px;
|
|
|
|
font-family: $font-family-title;
|
2016-05-28 04:44:28 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
border-bottom: 1px solid #ebe8df;
|
|
|
|
cursor: pointer;
|
2016-05-28 04:44:28 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
transition: 0.25s;
|
2016-05-28 04:44:28 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
&:hover {
|
|
|
|
color: #fff;
|
|
|
|
}
|
2016-05-26 03:07:18 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
@include dropdown-theme('green', $green);
|