mirror of
https://github.com/kogakure/website-astro-stefanimhoff.de.git
synced 2026-02-04 04:25:28 +00:00
refactor: migrate Preact components to Astro
This commit is contained in:
21
src/components/Title.astro
Normal file
21
src/components/Title.astro
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
// Cspell:words astro classnames keyof
|
||||
import cx from 'classnames';
|
||||
|
||||
export interface Props {
|
||||
as?: keyof astroHTML.JSX.IntrinsicElements;
|
||||
class?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
const { as: Tag = 'h1', class: className, ...props } = Astro.props;
|
||||
|
||||
const classes = cx(
|
||||
'text-7 font-black tracking-tight mbe-13 dark:font-extrabold [text-wrap:balance]',
|
||||
className
|
||||
);
|
||||
---
|
||||
|
||||
<Tag class={classes} {...props}>
|
||||
<slot />
|
||||
</Tag>
|
||||
Reference in New Issue
Block a user