Instead of having baked-in divider color, padding, etc, make the CSS generator a function of some configuration record. The generator function can't exist inside a splice like the current implementation, but a SomeGridT existential could be added to the Grid record to allow for pre-parameterized and pre-compiled grid themes based on the generator.
data GridConfiguration = GridConfiguration
{ padding :: ...
, relaxedPadding :: ...
, ...
}
instance Default GridConfiguration where
def = GridConfiguration {..}
where
...
gridCSS :: GridConfiguration -> CSS ()
gridCSS GridConfiguration {..} = ...
data SomeGridT = SomeGridT (CSS ())
instance Default SomeGridT where
def = SomeGridT $(mkRawCSS $ gridCSS def)
instance Themeable SomeGridT where
theme _ (SomeGridT gt) = gt
data Grid = Grid
{ ...
, theme :: SomeGridT
}
instance Pure Grid where
view Grid {..} =
let cs = ...
in as (features & Classes cs & Theme theme) children
Instead of having baked-in divider color, padding, etc, make the CSS generator a function of some configuration record. The generator function can't exist inside a splice like the current implementation, but a SomeGridT existential could be added to the Grid record to allow for pre-parameterized and pre-compiled grid themes based on the generator.
Or something like this.