Skip to content

Commit

Permalink
Support grid areas on mobile viewports
Browse files Browse the repository at this point in the history
  • Loading branch information
danielguillan committed Nov 13, 2024
1 parent 6203eb0 commit 4c13a6d
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions packages/react/src/PricingOptions/PricingOptions.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,22 @@
--brand-pricing-options-item-gap: var(--brand-PricingOptions-items-gap);
--brand-pricing-options-container-padding-inline: 0;

/* prettier-ignore */
--brand-pricing-options-template-areas:
'leadingComponent'
'label'
'heading'
'description'
'price'
'actions'
'feature-list'
'footnote'
;

display: grid;
grid-template-columns: 1fr;
grid-template-rows: auto;
row-gap: var(--brand-pricing-options-item-gap);
grid-template-areas: var(--brand-pricing-options-template-areas);
grid-auto-rows: min-content;

padding-inline: var(--brand-pricing-options-container-padding-inline);
}

Expand Down Expand Up @@ -113,20 +125,9 @@
@media (min-width: 63.25rem) {
.PricingOptions--items2,
.PricingOptions--items3 {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
column-gap: var(--brand-pricing-options-item-gap);
row-gap: 0;

grid-template-areas:
'leadingComponent'
'label'
'heading'
'description'
'price'
'actions'
'feature-list'
'footnote';
}

.PricingOptions--variant-default.PricingOptions--items2 {
Expand All @@ -144,9 +145,13 @@
/* Item inner layout */
/* ---------------------------------------------------------- */

.PricingOptions__item {
display: grid;
grid-template-areas: var(--brand-pricing-options-template-areas);
}

@media (min-width: 63.28rem) {
.PricingOptions__item {
display: grid;
grid-row: label / footnote;
grid-template-rows: subgrid;
}
Expand All @@ -166,15 +171,7 @@
.PricingOptions__item {
grid-template-columns: 1fr;
grid-template-rows: auto;
grid-template-areas:
'leadingComponent'
'label'
'heading'
'description'
'price'
'actions'
'feature-list'
'footnote';
grid-template-areas: var(--brand-pricing-options-template-areas);
}
}
}
Expand Down

0 comments on commit 4c13a6d

Please sign in to comment.