creator/web/src/components/Section.astro
enricobuehler 518b819fe8 update readme
recreate web
- now using tailwind instead of unocss
- created theme/design system
- created first components
- add first sections/content
2023-06-25 13:31:24 +02:00

28 lines
632 B
Plaintext

---
import type { HTMLAttributes } from "astro/types";
import { cva, type VariantProps } from "class-variance-authority";
const section = cva("relative w-full", {
variants: {
padding: {
true: "p-main",
false: "p-0",
},
maxWidth: {
true: "max-w-section mx-auto",
false: "",
},
},
});
export interface Props
extends HTMLAttributes<"section">,
VariantProps<typeof section> {}
const { padding = true, maxWidth = true, ...props } = Astro.props;
---
<section {...props} class={section({ padding, maxWidth })}>
<slot />
</section>