Skip to content

Commit 7235f03

Browse files
Issue #531: Update "ThemedSection" component to responsively reduce vertical padding on smaller screens (#534)
* Update "ThemedSection" component to responsively reduce vertical padding sizes for smaller screens. Achieve this by applying the pattern established by the existing "ColumnedHero" component. Remove existing optional padding class from "ThemedSection" component to unify the look across the website. * Change "verticalPaddings" property to "yPaddings"
1 parent 1ac7a16 commit 7235f03

11 files changed

Lines changed: 14 additions & 13 deletions

File tree

astro/src/components/ThemedSection.astro

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ interface Props {
44
theme?: string;
55
style?: string;
66
text?: boolean;
7-
py?: number;
7+
yPaddings?: Array<string>;
88
fluid?: boolean;
99
}
1010
@@ -13,17 +13,18 @@ const {
1313
theme = undefined,
1414
style = undefined,
1515
text = false,
16-
py = 5,
16+
yPaddings = ["xs-1", "sm-2", "md-3", "lg-4"],
1717
fluid = false,
1818
} = Astro.props;
1919
2020
import { getBackgroundAndText } from "../lib/themes.ts";
2121
2222
const bgAndTextClass = getBackgroundAndText(theme, style, text);
23+
const yPaddingClasses = yPaddings.map((p) => `py-${p}`);
2324
---
2425

2526
<section {id} class:list={[bgAndTextClass, "py-4"]}>
26-
<div class:list={[`container${fluid ? "-fluid" : ""}`, `py-${py}`]}>
27+
<div class:list={[`container${fluid ? "-fluid" : ""}`, yPaddingClasses]}>
2728
<slot />
2829
</div>
2930
</section>

astro/src/layouts/BlogLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ import ThemedSection from "@components/ThemedSection.astro";
9292
<strong>Blog</strong>
9393
</slot>
9494
</ImageHeading>
95-
<ThemedSection style="tertiary" py={0}>
95+
<ThemedSection style="tertiary">
9696
<div class="d-flex gap-4">
9797
<article class:list={[sidebar ? "d-none d-lg-block" : "col", "col-lg-9"]}>
9898
<h1 class="display-4 border-bottom mb-3" set:text={blog.data.title} />

astro/src/layouts/PolicyLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const metadata: PageMetadata = {
2222
{title}
2323
</slot>
2424
</ImageHeading>
25-
<ThemedSection style="secondary" py={2}>
25+
<ThemedSection style="secondary">
2626
<div class="d-print-none text-end pb-2">
2727
<button class="btn btn-contrast-dark btn-info" onclick="window.print()">
2828
Print this page

astro/src/layouts/TipLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const metadata: PageMetadata = {
132132
</div>
133133
</ThemedSection>
134134

135-
<ThemedSection style="secondary" py={3}>
135+
<ThemedSection style="secondary">
136136
<TipLicense />
137137
</ThemedSection>
138138
</Layout>

astro/src/pages/blog/authors/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import ThemedSection from "../../../components/ThemedSection.astro";
2323
<ImageHeading image="blog" slot="header">
2424
<strong>Blogs</strong> by author
2525
</ImageHeading>
26-
<ThemedSection style="tertiary" py={0}>
26+
<ThemedSection style="tertiary">
2727
<h2 class="text-info-emphasis display-5" set:text={title} />
2828
<ul>
2929
{

astro/src/pages/blog/dates/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import ThemedSection from "../../../components/ThemedSection.astro";
2424
<ImageHeading image="blog" slot="header">
2525
<strong>Blogs</strong> by date
2626
</ImageHeading>
27-
<ThemedSection style="tertiary" py={0}>
27+
<ThemedSection style="tertiary">
2828
<h2 class="text-info-emphasis display-5" set:text={title} />
2929
<ul>
3030
{

astro/src/pages/blog/topics/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import ThemedSection from "../../../components/ThemedSection.astro";
2424
<ImageHeading image="blog" slot="header">
2525
<strong>Blogs</strong> by topic
2626
</ImageHeading>
27-
<ThemedSection style="tertiary" py={0}>
27+
<ThemedSection style="tertiary">
2828
<h2 class="text-info-emphasis display-5" set:text={title} />
2929
<ul>
3030
{

astro/src/pages/escape-room/_csun-2025.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const timeSlots = ["7:20", "7:50", "8:20", "8:50", "9:20"];
6262
</Hero>
6363

6464
<img src="/images/wave.svg" class="wave" />
65-
<ThemedSection id="form" theme="secondary" style="subtle" py={2}>
65+
<ThemedSection id="form" theme="secondary" style="subtle">
6666
<h2 class="display-3 mb-4">
6767
CSUN <strong>Escape Room</strong> Registration
6868
</h2>

astro/src/pages/escape-room/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import woodenPuzzles from "src/images/escape-room/wooden-puzzles.png";
3232
---
3333

3434
<EscapeRoomLayout {metadata} {title}>
35-
<ThemedSection slot="header" theme="info" py={4}>
35+
<ThemedSection slot="header" theme="info">
3636
<div
3737
class="d-flex flex-column flex-lg-row gap-4 py-3 justify-content-lg-center align-items-center"
3838
>

astro/src/pages/podcasts/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ import ThemedBox from "@components/ThemedBox.astro";
7373
</ImageHeading>
7474
{
7575
shows.map((show, index) => (
76-
<ThemedSection style={(index % 2) ? "tertiary" : undefined} id={show.id} py={3}>
76+
<ThemedSection style={(index % 2) ? "tertiary" : undefined} id={show.id}>
7777
{index === 0
7878
? <ThemedBox theme="primary" style="subtle" border={1} padding={3} class="mb-5 p-3 rounded">
7979
<div class="d-flex flex-column flex-lg-row justify-content-center column-gap-3 align-items-center mt-2">

0 commit comments

Comments
 (0)