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'
|
type Units = 'rem' | '%' | 'px'
|
||||||
|
|
||||||
export function AutoGrid(
|
export function AutoGrid(
|
||||||
{ columnWidth, children }: {
|
{ columnWidth, children, style }: {
|
||||||
columnWidth: `${number}${Units}`
|
columnWidth: `${number}${Units}`
|
||||||
children: JSX.Element | JSX.Element[]
|
children: JSX.Element | JSX.Element[]
|
||||||
|
style?: JSX.CSSProperties
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
class='components__auto_grid'
|
class='components__auto_grid'
|
||||||
style={{
|
style={{
|
||||||
gridTemplateColumns: `repeat(auto-fit, minmax(${columnWidth}, 1fr));`,
|
gridTemplateColumns:
|
||||||
|
`repeat(auto-fit, minmax(${columnWidth}, 1fr));`,
|
||||||
|
...style,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|
Loading…
Reference in a new issue