Hacker News new | ask | show | jobs
by hello1234567 1291 days ago
there is a different way to achieve the same results. instead of encoding every possible rule into classes, a combination of flex box-classes, templating and text props could be used. <flex container> <li #if index % 3 ####css-prop> </li> <other cases> </end-container>

there is some repetition, but it will keep things simple.

same thing for spacing example, have a margin prop on a flex box container and apply it on each container then wrap them into a flex container.

it will be easier compose to compose vs css class variation.