Skip to content

Commit 9aefc48

Browse files
committed
Adjust block chooser styles to match latest designs
1 parent db87deb commit 9aefc48

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

client/src/components/ComboBox/ComboBox.scss

+17-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Ensure consistent spacing across the whole component.
22
// With the scrolling and show/hide of the field, correct spacing is critical.
33
$spacing: theme('spacing.[2.5]');
4-
$spacing-sm: theme('spacing.5');
5-
$width: min(1000px, 75vw);
4+
$spacing-sm: theme('spacing.4');
5+
$width: clamp(300px, 75vw, 1000px);
66

77
.w-combobox-container {
88
@include dark-theme() {
@@ -28,9 +28,9 @@ $width: min(1000px, 75vw);
2828

2929
// Case 1: base case
3030
// 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.
3232
width: max-content;
33-
max-width: 75vw;
33+
max-width: max(300px, 75vw);
3434

3535
// Case 2: there's a previewable block, but the preview may or may not be active
3636
// On smaller screens, the preview will be shown below. We don't want the
@@ -87,12 +87,13 @@ $width: min(1000px, 75vw);
8787
display: grid;
8888
grid-template-columns: 1fr 1fr;
8989
grid-auto-flow: column;
90-
gap: theme('spacing.[0.5]');
90+
gap: theme('spacing.1');
9191
padding: $spacing;
9292
padding-top: 0;
9393

9494
@include media-breakpoint-up(sm) {
9595
width: 100%;
96+
column-gap: theme('spacing.5');
9697
padding: $spacing-sm;
9798
padding-top: 0;
9899
}
@@ -120,15 +121,22 @@ $width: min(1000px, 75vw);
120121
}
121122

122123
.w-combobox__option-preview {
124+
@include more-contrast-interactive();
125+
@include show-focus-outline-inside();
126+
color: theme('colors.icon-secondary');
123127
background: none;
128+
border: 1px solid transparent;
124129
padding: 0;
125130
width: 100%;
126131

127132
.icon {
128-
color: theme('colors.icon-secondary');
129133
width: theme('spacing.3');
130134
height: theme('spacing.3');
131135
}
136+
137+
&:hover {
138+
color: theme('colors.icon-secondary-hover');
139+
}
132140
}
133141

134142
.w-combobox__option-row--col1 {
@@ -143,17 +151,17 @@ $width: min(1000px, 75vw);
143151
display: grid;
144152
grid-template-columns: theme('spacing.8') 1fr;
145153
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');
148156
font-size: 0.875rem;
149157
line-height: theme('lineHeight.tight');
150158
border-radius: theme('borderRadius.sm');
159+
cursor: pointer;
151160

152161
&[aria-selected='true'] {
153162
border-color: theme('colors.border-button-outline-default');
154163
color: theme('colors.text-link-default');
155164
background: transparent;
156-
cursor: pointer;
157165

158166
@media (forced-colors: active) {
159167
background: Highlight;

0 commit comments

Comments
 (0)