1
1
// Ensure consistent spacing across the whole component.
2
2
// With the scrolling and show/hide of the field, correct spacing is critical.
3
3
$spacing : theme (' spacing.[2.5]' );
4
- $spacing-sm : theme (' spacing.5 ' );
5
- $width : min ( 1000 px , 75vw );
4
+ $spacing-sm : theme (' spacing.4 ' );
5
+ $width : clamp ( 300 px , 75vw , 1000 px );
6
6
7
7
.w-combobox-container {
8
8
@include dark-theme () {
@@ -28,9 +28,9 @@ $width: min(1000px, 75vw);
28
28
29
29
// Case 1: base case
30
30
// Use max-content width to minimize shifting due to content wrapping,
31
- // while also ensuring it's not wider than 75% of the viewport .
31
+ // constraining width to 75% of viewport for devices above 400px width .
32
32
width : max-content ;
33
- max-width : 75vw ;
33
+ max-width : max ( 300 px , 75vw ) ;
34
34
35
35
// Case 2: there's a previewable block, but the preview may or may not be active
36
36
// On smaller screens, the preview will be shown below. We don't want the
@@ -87,12 +87,13 @@ $width: min(1000px, 75vw);
87
87
display : grid ;
88
88
grid-template-columns : 1fr 1fr ;
89
89
grid-auto-flow : column ;
90
- gap : theme (' spacing.[0.5] ' );
90
+ gap : theme (' spacing.1 ' );
91
91
padding : $spacing ;
92
92
padding-top : 0 ;
93
93
94
94
@include media-breakpoint-up (sm) {
95
95
width : 100% ;
96
+ column-gap : theme (' spacing.5' );
96
97
padding : $spacing-sm ;
97
98
padding-top : 0 ;
98
99
}
@@ -120,15 +121,22 @@ $width: min(1000px, 75vw);
120
121
}
121
122
122
123
.w-combobox__option-preview {
124
+ @include more-contrast-interactive ();
125
+ @include show-focus-outline-inside ();
126
+ color : theme (' colors.icon-secondary' );
123
127
background : none ;
128
+ border : 1px solid transparent ;
124
129
padding : 0 ;
125
130
width : 100% ;
126
131
127
132
.icon {
128
- color : theme (' colors.icon-secondary' );
129
133
width : theme (' spacing.3' );
130
134
height : theme (' spacing.3' );
131
135
}
136
+
137
+ & :hover {
138
+ color : theme (' colors.icon-secondary-hover' );
139
+ }
132
140
}
133
141
134
142
.w-combobox__option-row--col1 {
@@ -143,17 +151,17 @@ $width: min(1000px, 75vw);
143
151
display : grid ;
144
152
grid-template-columns : theme (' spacing.8' ) 1fr ;
145
153
align-items : center ;
146
- padding : theme (' spacing.2 ' );
147
- border : 1px solid transparent ;
154
+ padding : theme (' spacing.[2.5] ' );
155
+ border : 1px dotted theme ( ' colors.border-button-small-outline-default ' ) ;
148
156
font-size : 0.875rem ;
149
157
line-height : theme (' lineHeight.tight' );
150
158
border-radius : theme (' borderRadius.sm' );
159
+ cursor : pointer ;
151
160
152
161
& [aria-selected = ' true' ] {
153
162
border-color : theme (' colors.border-button-outline-default' );
154
163
color : theme (' colors.text-link-default' );
155
164
background : transparent ;
156
- cursor : pointer ;
157
165
158
166
@media (forced-colors : active ) {
159
167
background : Highlight ;
0 commit comments