mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
33 lines
698 B
Plaintext
33 lines
698 B
Plaintext
---
|
|
import { twMerge } from 'tailwind-merge';
|
|
|
|
/**
|
|
* ContentWidth frame component for constraining content width.
|
|
*
|
|
* Applies the standard max-width constraint used throughout the docs
|
|
* without any visual styling (borders, backgrounds).
|
|
*
|
|
* Usage:
|
|
* ```mdx
|
|
* import ContentWidth from '@/components/frames/ContentWidth.astro';
|
|
*
|
|
* <ContentWidth>
|
|
* <MyComponent client:idle />
|
|
* </ContentWidth>
|
|
* ```
|
|
*/
|
|
|
|
type Props = {
|
|
class?: string;
|
|
margins?: 'default' | 'lg';
|
|
};
|
|
|
|
const { class: className, margins = 'default' } = Astro.props;
|
|
|
|
const marginClass = margins === 'lg' ? 'my-12' : 'my-6';
|
|
---
|
|
|
|
<div class={twMerge('max-w-3xl mx-auto', marginClass, className)}>
|
|
<slot />
|
|
</div>
|