blob: 9fd84d4cd7d70fd6610176ffd84ce3880b6b679b [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001@charset "UTF-8";
2
3/**
4 * @license
5 * Copyright 2016 Leif Olsen. All Rights Reserved.
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 * This code is built with Google Material Design Lite,
20 * which is Licensed under the Apache License, Version 2.0
21 */
22
23/* Moved to aria-expanded-toggle.scss
24
25.mdlext-aria-expanded-plus-minus {
26 @include mdlext-aria-expanded-toggle($font-family: inherit);
27}
28
29.mdlext-aria-expanded-more-less {
30 @include mdlext-aria-expanded-toggle($icon: 'expand_more', $icon-expanded: 'expand_less');
31}
32*/
33
34.mdlext-menu-button {
35 box-sizing: border-box;
36 @include typo-menu();
37 text-transform: none;
38 position: relative;
39 height: $button-height;
40 padding: 0 $button-padding;
41 display: flex;
42 align-items: center;
43 align-self: stretch;
44
45 > * {
46 margin: 0;
47 padding: 0 0 0 8px;
48 }
49
50 > *:first-child {
51 padding-left: 0;
52 }
53
54 > *:last-child:not(:only-child):not(.mdlext-menu__item__caption) {
55 margin-left: auto; // If more than one element, push last element to the right
56 }
57
58}
59
60.mdlext-menu-button__caption {
61 white-space: nowrap;
62 overflow: hidden;
63 text-overflow: ellipsis;
64 line-height: 1.2;
65}
66
67.mdlext-menu,
68.mdlext-menu__item {
69 box-sizing: border-box;
70 margin: 0;
71 padding: 0;
72 list-style: none;
73 display: flex;
74}
75
76.mdlext-menu {
77 position: absolute; //fixed;
78 background: $default-dropdown-bg-color;
79 z-index: 1000;
80 min-width: 124px;
81 border-radius: 2px;
82 @include shadow-3dp();
83 display: inline-flex;
84 flex-direction: column;
85 padding: 0;
86 overflow: hidden;
87 overflow-y: auto;
88
89 &:focus {
90 outline-offset: -1px;
91 outline-width: 1px;
92 }
93
94 &[hidden] {
95 @include mdlext-visually-hidden;
96 pointer-events: none;
97 }
98
99 &__item {
100 @include typo-body-1();
101 color: $default-item-text-color;
102 background-color: $default-dropdown-bg-color;
103 position: relative;
104 padding: 0 16px 0 24px;
105 align-items: center;
106 align-self: stretch;
107 text-decoration: none;
108 cursor: pointer;
109 white-space: nowrap;
110 user-select: none;
111 min-height: 40px;
112 overflow: hidden;
113
114 &[aria-selected='true'] {
115 background-color: $default-item-active-bg-color;
116 }
117
118 // checkmark
119 &[aria-selected='true']::before {
120 content:'\2713';
121 position: absolute;
122 font-size: 1.4em;
123 left: 4px;
124 top: 50%;
125 transform: translateY(-50%);
126 pointer-events: none;
127 }
128
129 &:hover:not([disabled]) {
130 background-color: $default-item-hover-bg-color;
131 }
132
133 &:focus {
134 outline-offset: -2px;
135 outline-width: 1px;
136 outline-color: $default-item-outline-color;
137 background-color: $default-item-focus-bg-color;
138 }
139
140 &::-moz-focus-inner {
141 border: 0;
142 }
143
144 &[disabled] {
145 color: $disabled-item-text-color;
146 background-color: transparent;
147 cursor: auto;
148 pointer-events: none;
149
150 > * {
151 color: $disabled-item-text-color;
152 }
153 }
154
155 &__caption {
156 white-space: nowrap;
157 overflow: hidden;
158 text-overflow: ellipsis;
159 }
160
161 > * {
162 margin: 0;
163 padding: 0 0 0 8px;
164 }
165
166 > *:first-child {
167 padding-left: 0;
168 }
169
170 > *:last-child:not(:only-child):not(.mdlext-menu__item__caption) {
171 margin-left: auto; // If more than one element, push last element to the right
172 }
173
174 }
175 &__item-separator {
176 margin: 0;
177 padding: 0;
178 border-bottom: 1px solid $default-item-divider-color;
179 }
180
181}