Added option to add background

This commit is contained in:
Patrick Alvin Alcala 2025-09-26 17:32:15 +08:00
parent 011460a533
commit ebebbee0c0

View file

@ -7,13 +7,14 @@ interface Props {
children: JSXElement children: JSXElement
curved?: boolean curved?: boolean
padding?: number padding?: number
background?: string
} }
export default (props: Props) => { export default (props: Props) => {
const boxClass = createMemo(() => (props.curved ? 'curvedbox' : 'box')) const boxClass = createMemo(() => (props.curved ? 'curvedbox' : 'box'))
return ( return (
<section class={boxClass()} style={`border: ${props.thickness}px solid ${props.color || 'white'}; padding: ${props.padding}rem`}> <section class={boxClass()} style={`border: ${props.thickness}px solid ${props.color || 'white'}; padding: ${props.padding}rem; background-color: ${props.background || 'none'}`}>
{props.children} {props.children}
</section> </section>
) )