Added option to add background
This commit is contained in:
parent
011460a533
commit
ebebbee0c0
1 changed files with 2 additions and 1 deletions
|
|
@ -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>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue