blob: 5ceaf6e2dbeb9d100c7fe3d09093bda30c00ee95 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
---
import type { HTMLAttributes } from 'astro/types';
const sizes = {
xs: 'text-xs',
sm: 'text-sm',
md: 'text-md',
lg: 'text-lg',
xl: 'text-xl',
};
interface Props extends HTMLAttributes<'p'> {
text?: string
size?: keyof typeof sizes
}
const {
text = '',
size = 'md',
...props
} = Astro.props;
const className = [
sizes[size],
props.class,
].join(' ');
---
<p class={className} {...props}>
{text || <slot/>}
</p>
|