5 The border is set on the parent, but the max height is set on a child container.
6 This breaks the available size computation because the parent element will be +2 pixels larger than the available max height.
7 This causes an infinite loop in the floating ui library. To prevent that, border size is subtracted in a calc in the max height set in .dropdown-content.
11 --custom-max-width: 20em;
12 --custom-max-height: 30em;
14 --max-width: min(var(--custom-max-width, 100vw), 100vw);
15 --max-height: min(var(--custom-max-height, 100vh), 100vh);
16 --selection-background-color: var(--interaction-norm);
17 --selection-text-color: var(--interaction-norm-contrast);
20 z-index: map.get($z-indexes, 'modals');
22 // NOTE: Don't use logical properties. RTL positioning is done in JS.
23 /* stylelint-disable */
26 /* stylelint-enable */
28 border-radius: var(--border-radius-md);
29 box-shadow: var(--shadow-lifted);
30 border: #{$border-size}px solid var(--border-norm);
31 background-color: var(--background-norm);
32 color: var(--text-norm);
33 animation: 0.15s easing(ease-out-cubic) both anime-dropdown-in-mouse;
35 @keyframes anime-dropdown-in-mouse {
37 transform: scale(0.75);
49 animation-name: anime-dropdown-out-mouse;
51 @keyframes anime-dropdown-out-mouse {
58 transform: scale(0.75);
64 @include transform-origins;
66 @include media('touch', '<=small') {
67 &.adaptive-for-touch-screens {
74 flex-flow: column nowrap;
75 justify-content: center;
77 border-radius: initial;
80 background-color: var(--backdrop-norm);
81 animation-name: anime-dropdown-in-touch;
83 @keyframes anime-dropdown-in-touch {
95 animation-name: anime-dropdown-out-touch;
97 @keyframes anime-dropdown-out-touch {
110 @include media('touch', '<=xsmall') {
111 &.adaptive-for-touch-screens {
116 /* Backdrop button, meant to override 'autoClose' option on mobile */
121 @include media('touch', '<=small') {
122 &.adaptive-for-touch-screens &-backdrop {
137 /* Scrollable frame inside the dropdown */
139 inline-size: var(--width);
140 block-size: var(--height);
141 min-inline-size: min(var(--min-width, 1.5em), 100vw);
142 min-block-size: min(var(--min-height, 1em), 100vh);
143 max-inline-size: calc(min(var(--available-width, var(--max-width)), var(--max-width)) - #{$border-size * 2}px);
144 max-block-size: calc(min(var(--available-height, var(--max-height)), var(--max-height)) - #{$border-size * 2}px);
146 border-radius: inherit;
147 background-color: var(--background-norm);
148 background-image: radial-gradient(farthest-side at 50% 0, var(--backdrop-norm), transparent),
149 radial-gradient(farthest-side at 50% 100%, var(--backdrop-norm), transparent);
153 background-size: calc(100% - #{rem(20)}) rem(3);
154 background-repeat: no-repeat;
164 background: var(--background-norm);
168 @include media('touch', '<=small') {
169 &.adaptive-for-touch-screens &-content {
173 max-inline-size: initial;
174 max-block-size: initial;
175 border-radius: var(--border-radius-md);
176 box-shadow: var(--shadow-lifted);
177 transition: transform 0.1s ease-out;
178 animation: anime-dropdown-content-scale-in 0.15s ease-out both;
180 @keyframes anime-dropdown-content-scale-in {
182 transform: scale(0.8);
191 &.adaptive-for-touch-screens.is-dropdown-out &-content {
192 animation-name: anime-dropdown-content-scale-out;
194 @keyframes anime-dropdown-content-scale-out {
200 transform: scale(0.8);
209 @extend .interactive-pseudo-inset;
221 color: var(--text-norm);
222 text-decoration: none;
230 .dropdown-item-button {
231 color: var(--signal-danger);
236 & [aria-current='true'],
243 background-color: var(--selection-background-color);
244 color: var(--selection-text-color);
245 pointer-events: none;
248 @supports not selector(:focus-visible) {
251 background-color: unset;
254 background-color: var(--selection-background-color);
255 box-shadow: 0 0 0 #{$focus-ring-size} var(--focus-ring);
261 @supports selector(:focus-visible) {
264 background-color: unset;
267 background-color: var(--selection-background-color);
268 box-shadow: 0 0 0 #{$focus-ring-size} var(--focus-ring);
275 // Used when the dropdown action item has a tooltip while being disabled
278 color: var(--text-norm);
280 font-weight: var(--font-weight-normal);
285 background-color: var(--background-norm);
289 // Dropdown item container which contains several elements
290 // Created for specific use case in the mail composer
292 @extend .interactive;
298 color: var(--text-norm);
299 text-decoration: none;
303 background-color: var(--interaction-default-hover);
306 &.dropdown-item--is-selected,
307 & .dropdown-item--is-selected {
316 .dropdown-item-button {
317 background-color: transparent;
322 background-color: transparent;
330 box-sizing: content-box;
331 border-block-start: 1px solid var(--border-norm);
336 inset-block-start: 0;
338 background-color: var(--background-norm);
339 box-shadow: var(--shadow-norm);
343 color: var(--text-weak);
344 padding-block: rem(40);
345 padding-inline: rem(10);
346 letter-spacing: rem(0.25);
351 .dropdown-content::before {