blob: db0bff6f067aeb7d762ff9d715c933a15837f62c (
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-inherit',
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>
|