Skip to content

Commit

Permalink
Update ChoiceList mobile styles
Browse files Browse the repository at this point in the history
  • Loading branch information
lgriffee committed Apr 19, 2024
1 parent 5ec03e7 commit fab4bbd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
15 changes: 13 additions & 2 deletions polaris-react/src/components/Choice/Choice.module.css
Expand Up @@ -22,11 +22,11 @@
cursor: pointer;
padding-block-start: calc(
var(--pc-choice-bleed-block-start, var(--pc-choice-space-0)) +
var(--p-space-100)
var(--p-space-300)
);
padding-block-end: calc(
var(--pc-choice-bleed-block-end, var(--pc-choice-space-0)) +
var(--p-space-100)
var(--p-space-300)
);
padding-inline-start: var(
--pc-choice-bleed-inline-start,
Expand Down Expand Up @@ -60,6 +60,17 @@
var(--pc-choice-bleed-block-start, var(--pc-choice-space-0)) +
var(--pc-choice-bleed-block-end, var(--pc-choice-space-0))
);

@media (--p-breakpoints-md-up) {
padding-block-start: calc(
var(--pc-choice-bleed-block-start, var(--pc-choice-space-0)) +
var(--p-space-100)
);
padding-block-end: calc(
var(--pc-choice-bleed-block-end, var(--pc-choice-space-0)) +
var(--p-space-100)
);
}
}

.labelHidden {
Expand Down
6 changes: 4 additions & 2 deletions polaris-react/src/components/ChoiceList/ChoiceList.module.css
@@ -1,4 +1,6 @@
.ChoiceChildren {
/* stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY */
padding-left: calc(var(--p-space-200) + 20px);
@media (--p-breakpoints-md-up) {
/* stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY */
padding-left: calc(var(--p-space-200) + 20px);
}
}
Expand Up @@ -138,7 +138,7 @@ export function WithChildrenContent() {
const renderChildren = useCallback(
() => (
<TextField
label="Minimum Quantity"
label="Minimum Purchase"
labelHidden
onChange={handleTextFieldChange}
value={textFieldValue}
Expand Down
8 changes: 2 additions & 6 deletions polaris-react/src/components/ChoiceList/ChoiceList.tsx
Expand Up @@ -101,9 +101,7 @@ export function ChoiceList({
? choice.renderChildren(isSelected)
: null;
const children = renderedChildren ? (
<div className={styles.ChoiceChildren}>
<Box paddingBlockStart={{xs: '400', md: '0'}}>{renderedChildren}</Box>
</div>
<div className={styles.ChoiceChildren}>{renderedChildren}</div>
) : null;
return (
<li key={value}>
Expand Down Expand Up @@ -143,9 +141,7 @@ export function ChoiceList({
id={finalName}
>
{titleMarkup}
<BlockStack as="ul" gap={{xs: '400', md: '0'}}>
{choicesMarkup}
</BlockStack>
<BlockStack as="ul">{choicesMarkup}</BlockStack>
{errorMarkup}
</BlockStack>
);
Expand Down

0 comments on commit fab4bbd

Please sign in to comment.