refactor: replace classnames with class:list

This commit is contained in:
Stefan Imhoff
2024-09-11 13:21:11 +02:00
parent 526fe22cda
commit c9461b356d
48 changed files with 535 additions and 538 deletions

View File

@@ -1,7 +1,5 @@
---
// Cspell:words astro classnames keyof
import cx from 'classnames';
// Cspell:words astro keyof
export interface Props {
as?: keyof astroHTML.JSX.IntrinsicElements;
class?: string;
@@ -9,13 +7,14 @@ export interface Props {
}
const { as: Tag = 'h3', class: className, ...props } = Astro.props;
const classes = cx(
'text-4 font-black tracking-tight mbe-8 dark:font-extrabold [text-wrap:balance]',
className
);
---
<Tag class={classes} {...props}>
<Tag
class:list={[
'text-4 font-black tracking-tight mbe-8 [text-wrap:balance] dark:font-extrabold',
className,
]}
{...props}
>
<slot />
</Tag>