fix: improve conditional Sidebar CSS
This commit is contained in:
@@ -8,12 +8,11 @@ import styles from "./loyaltyPage.module.css"
|
|||||||
|
|
||||||
export default async function LoyaltyPage() {
|
export default async function LoyaltyPage() {
|
||||||
const loyaltyPage = await serverClient().contentstack.loyaltyPage.get()
|
const loyaltyPage = await serverClient().contentstack.loyaltyPage.get()
|
||||||
const hasSidebar = !!loyaltyPage.sidebar.length
|
|
||||||
return (
|
return (
|
||||||
<section
|
<section className={styles.content}>
|
||||||
className={`${styles.content} ${hasSidebar && styles.hasLeftSidebar}`}
|
{loyaltyPage.sidebar.length ? (
|
||||||
>
|
<Sidebar blocks={loyaltyPage.sidebar} />
|
||||||
{hasSidebar && <Sidebar blocks={loyaltyPage.sidebar} />}
|
) : null}
|
||||||
|
|
||||||
<MaxWidth className={styles.blocks} tag="main">
|
<MaxWidth className={styles.blocks} tag="main">
|
||||||
{loyaltyPage.blocks ? <Blocks blocks={loyaltyPage.blocks} /> : null}
|
{loyaltyPage.blocks ? <Blocks blocks={loyaltyPage.blocks} /> : null}
|
||||||
|
|||||||
@@ -13,10 +13,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 950px) {
|
@media screen and (min-width: 950px) {
|
||||||
.hasLeftSidebar {
|
|
||||||
grid-template-columns: 30rem 1fr;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
gap: 2.7rem;
|
gap: 2.7rem;
|
||||||
padding-bottom: 17.5rem;
|
padding-bottom: 17.5rem;
|
||||||
@@ -25,6 +21,10 @@
|
|||||||
padding-top: 5.8rem;
|
padding-top: 5.8rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.content:has(> aside) {
|
||||||
|
grid-template-columns: 30rem 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
.blocks {
|
.blocks {
|
||||||
gap: 6.4rem;
|
gap: 6.4rem;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user