feat(components): ✨ allow custom styles for AutoGrid
This commit is contained in:
parent
21f5009b7a
commit
4fcfd34bbb
|
@ -3,16 +3,19 @@ import { JSX } from 'preact'
|
|||
type Units = 'rem' | '%' | 'px'
|
||||
|
||||
export function AutoGrid(
|
||||
{ columnWidth, children }: {
|
||||
{ columnWidth, children, style }: {
|
||||
columnWidth: `${number}${Units}`
|
||||
children: JSX.Element | JSX.Element[]
|
||||
style?: JSX.CSSProperties
|
||||
},
|
||||
) {
|
||||
return (
|
||||
<div
|
||||
class='components__auto_grid'
|
||||
style={{
|
||||
gridTemplateColumns: `repeat(auto-fit, minmax(${columnWidth}, 1fr));`,
|
||||
gridTemplateColumns:
|
||||
`repeat(auto-fit, minmax(${columnWidth}, 1fr));`,
|
||||
...style,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
|
|
Loading…
Reference in a new issue