Added box component

This commit is contained in:
Patrick Alvin Alcala 2025-09-02 16:08:33 +08:00
parent 982e3ba249
commit f4beb0bea5
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,6 @@
.box
padding: 1rem
.curvedbox
@extend .box
border-radius: 8px

View file

@ -0,0 +1,20 @@
import type { ImageMetadata } from 'astro'
import './Box.sass'
import { Show, type JSXElement, createMemo } from 'solid-js'
interface Props {
thickness: number
color?: string
children: JSXElement
curved?: boolean
}
export default (props: Props) => {
const boxClass = createMemo(() => (props.curved ? 'curvedbox' : 'box'))
return (
<section class={boxClass()} style={{ border: `${props.thickness}px solid ${props.color || 'white'}` }}>
{props.children}
</section>
)
}