simplified page padding scheme

This commit is contained in:
tresabhi committed 2026-11-21 19:33:55 -06:00
1 parent baf42d0273
commit 9efcb55083
30 files changed
+129 -196

No files matched your search

@@ -1,24 +1,25 @@
.section {
padding: var(--space-4);
@media (pointer: fine) {
padding-left: 0;
}
display: flex;
justify-content: center;
flex-direction: column;
padding-right: var(--page-padding);
/* astro island's children sometimes end up being first deeper into the div's */
&:first-child:not(astro-island > &) {
padding-top: var(--page-padding);
}
&:last-child {
flex: 1;
padding-bottom: var(--page-padding);
}
.content {
flex: 1;
max-width: var(--page-width);
@media (pointer: coarse) {
padding-left: var(--page-padding);
}
gap: var(--space-5);
display: flex;
flex-direction: column;
&[data-overflow="true"] {
padding-right: 0;
overflow-x: auto;
}
}
@@ -2,13 +2,17 @@ import type { ComponentProps } from "react";
import { classNames } from "../../ui/classNames";
import styles from "./index.module.css";
export interface SectionProps extends ComponentProps<"div"> {}
export interface SectionProps extends ComponentProps<"section"> {
overflow?: boolean;
}
// TODO: reevaluate the usefulness of this as it seems to do very little
export function Section({ className, children, ...props }: SectionProps) {
export function Section({ className, overflow, ...props }: SectionProps) {
return (
<div className={classNames(styles.section, className)} {...props}>
<div className={styles.content}>{children}</div>
</div>
<section
className={classNames(styles.section, className)}
data-overflow={overflow || undefined}
{...props}
/>
);
}