Skip to content

Commit ded1555

Browse files
committed
fix(picker): use correct spacing between icons and label text
The spacing between alert icon and disclosure icon was incorrect because it was being overridden by a selector that shouldn't have been affecting this scenario. The selector was matching because it was using the subsequent-sibling combinator (~) instead of the next-sibling combinator (+) -- that CSS was meant only for the case of the spacing between label text and disclosure icon, when there is no invalid icon or progress circle.
1 parent cfa0583 commit ded1555

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

components/picker/index.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,13 @@ governing permissions and limitations under the License.
343343
&.is-loading,
344344
&.is-invalid {
345345
.spectrum-Picker-label {
346+
/* Spacing after label text when there is an invalid icon or progress circle. */
346347
margin-inline-end: var(--mod-picker-spacing-text-to-icon-inline-end, var(--spectrum-picker-spacing-text-to-icon-inline-end));
347348
}
348349
}
349350
}
350351

351-
/* Optional icon that appears before the text within the picker. */
352+
/* Optional workflow icon that appears before the text within the picker. */
352353
.spectrum-Picker .spectrum-Picker-icon {
353354
flex-shrink: 0;
354355
margin-inline-end: var(--mod-picker-spacing-text-to-icon, var(--spectrum-picker-spacing-text-to-icon));
@@ -435,7 +436,8 @@ governing permissions and limitations under the License.
435436
margin-block-end: calc(var(--mod-picker-spacing-top-to-progress-circle, var(--spectrum-picker-spacing-top-to-progress-circle)) - var(--mod-picker-border-width, var(--spectrum-picker-border-width)));
436437
}
437438

438-
.spectrum-Picker-label ~ .spectrum-Picker-menuIcon {
439+
.spectrum-Picker-label + .spectrum-Picker-menuIcon {
440+
/* Spacing after label text when there is no invalid icon or progress circle (to disclosure icon). */
439441
margin-inline-start: var(--mod-picker-spacing-text-to-icon, var(--spectrum-picker-spacing-text-to-icon));
440442
}
441443

0 commit comments

Comments
 (0)