Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ChoiceList mobile styles #11896

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/nervous-shoes-unite.md
@@ -0,0 +1,5 @@
---
'@shopify/polaris': minor
---

Updated `ChoiceList` mobile styles
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 @@ -152,7 +152,7 @@ export const 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