|
3 | 3 | @use "@db-ux/core-foundations/build/styles/colors"; |
4 | 4 | @use "@db-ux/core-foundations/build/styles/icons"; |
5 | 5 | @use "@db-ux/core-foundations/build/styles/fonts"; |
| 6 | +@use "@db-ux/core-foundations/build/styles/helpers"; |
6 | 7 | @use "../../styles/internal/form-components"; |
7 | 8 | @use "../../styles/internal/component"; |
8 | 9 | @use "../../styles/internal/select-components"; |
|
67 | 68 | /* stylelint-disable-next-line selector-pseudo-element-no-unknown */ |
68 | 69 | :is(::picker(select)) { |
69 | 70 | @extend %default-card; |
| 71 | + |
| 72 | + // Adapted from .db-custom-select-dropdown |
| 73 | + position: absolute; |
| 74 | + z-index: 32; |
| 75 | + box-shadow: variables.$db-elevation-md; |
| 76 | + min-inline-size: variables.$db-sizing-xl; |
| 77 | + max-inline-size: calc( |
| 78 | + 100vw - 2 * #{variables.$db-spacing-fixed-sm} |
| 79 | + ); |
| 80 | + |
| 81 | + // Adapted from .db-card |
| 82 | + background-color: colors.$db-adaptive-bg-basic-level-1-default; |
| 83 | + padding: variables.$db-spacing-fixed-sm; |
| 84 | + |
| 85 | + // Adapted from .db-custom-select-list |
| 86 | + overflow-block: auto; |
| 87 | + |
| 88 | + /* (option height + padding) * 5.5 items (showing partial item to indicate more content) + list padding */ |
| 89 | + max-block-size: calc( |
| 90 | + 5.5 * |
| 91 | + ( |
| 92 | + ( |
| 93 | + #{form-components.$font-size-height} - 2 * |
| 94 | + #{variables.$db-border-width-3xs} |
| 95 | + ) + |
| 96 | + 2 * #{variables.$db-spacing-fixed-sm} |
| 97 | + ) + |
| 98 | + (#{variables.$db-spacing-fixed-sm} * 2) |
| 99 | + ); |
70 | 100 | } |
71 | 101 |
|
72 | 102 | option { |
| 103 | + // Adapted from .db-custom-select-list-item |
| 104 | + position: relative; |
| 105 | + padding: variables.$db-spacing-fixed-sm; |
| 106 | + background-color: colors.$db-adaptive-bg-basic-transparent-full-default; |
| 107 | + border-radius: variables.$db-border-radius-xs; |
| 108 | + box-sizing: border-box; |
73 | 109 | justify-content: space-between; |
74 | | - |
| 110 | + |
75 | 111 | // change order of the included text and pseudo-element within this flexbox item, to make sure the icon is always on the right |
76 | 112 | flex-direction: row-reverse; |
77 | 113 |
|
78 | 114 | &:checked { |
79 | 115 | font-weight: 700; |
80 | 116 | } |
81 | 117 |
|
| 118 | + // Hover states adapted from .db-custom-select-list-item |
| 119 | + &:not(:checked) { |
| 120 | + @include helpers.hover { |
| 121 | + background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered; |
| 122 | + } |
| 123 | + |
| 124 | + @include helpers.active { |
| 125 | + background-color: colors.$db-adaptive-bg-basic-transparent-full-pressed; |
| 126 | + } |
| 127 | + } |
| 128 | + |
82 | 129 | /* stylelint-disable-next-line selector-pseudo-element-no-unknown */ |
83 | 130 | :is(&::checkmark) { |
84 | 131 | @extend %icon; |
|
0 commit comments