Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore(design-system): align PageSectionAside to bottom of text content (#41629)

Danny White6837e1b9f491
diff --git a/apps/design-system/content/docs/ui-patterns/layout.mdx b/apps/design-system/content/docs/ui-patterns/layout.mdx
index e69716e597e..4ee7a5bb1cb 100644
--- a/apps/design-system/content/docs/ui-patterns/layout.mdx
+++ b/apps/design-system/content/docs/ui-patterns/layout.mdx
@@ -75,6 +75,6 @@ Detail pages display dense or lengthy content split into multiple sections. The
## Components
-- **[PageContainer](/docs/fragments/page-container)** - Container component providing consistent max-width and padding based on size variants
-- **[PageHeader](/docs/fragments/page-header)** - Compound component for building page headers with breadcrumbs, icons, titles, descriptions, actions, and navigation
-- **[PageSection](/docs/fragments/page-section)** - Compound component for organizing page content into distinct sections with title, description, and action areas
+- **[Page Container](../fragments/page-container)**: Container component providing consistent max-width and padding based on size variants
+- **[Page Header](../fragments/page-header)**: Compound component for building page headers with breadcrumbs, icons, titles, descriptions, actions, and navigation
+- **[Page Section](../fragments/page-section)**: Compound component for organizing page content into distinct sections with title, description, and action areas
diff --git a/packages/ui-patterns/src/PageSection/index.tsx b/packages/ui-patterns/src/PageSection/index.tsx
index b13fc7c3829..47f24c6f29d 100644
--- a/packages/ui-patterns/src/PageSection/index.tsx
+++ b/packages/ui-patterns/src/PageSection/index.tsx
@@ -66,7 +66,12 @@ const PageSectionSummary = ({ className, children, ...props }: PageSectionSummar
return (
<div
data-slot="page-section-summary"
- className={cn('flex flex-col gap-1', className)}
+ className={cn(
+ 'flex flex-col gap-1',
+ // Center alignment with PageSection Aside in case no PageSectionDescription present
+ '@xl:self-center',
+ className
+ )}
{...props}
>
{children}
@@ -109,6 +114,13 @@ const PageSectionDescription = ({ className, children, ...props }: PageSectionDe
<div
data-slot="page-section-description"
className={cn('text-sm text-foreground-light', className)}
+ // Optically align with bottom of PageSectionAside
+ // trim-end is not available in Tailwind CSS
+ style={
+ {
+ textBoxTrim: 'trim-end',
+ } as React.CSSProperties
+ }
{...props}
>
{children}
@@ -132,7 +144,12 @@ const PageSectionAside = ({ className, ...props }: PageSectionAsideProps) => {
return (
<div
data-slot="page-section-aside"
- className={cn('flex items-center gap-2', className)}
+ className={cn(
+ 'flex items-center gap-2',
+ // Align with bottom of PageSectionDescription
+ '@xl:self-end',
+ className
+ )}
{...props}
/>
)