MuckRock / documentcloud-frontend

DocumentCloud's front end source code - Please report bugs, issues and feature requests to info@documentcloud.org
https://www.documentcloud.org
GNU Affero General Public License v3.0
18 stars 5 forks source link

Use style tag instead of inline styles for <Flex> component #854

Open eyeseast opened 1 day ago

eyeseast commented 1 day ago

This way of writing styles makes fro a lot of noise to sort through:

<div style="display: flex; flex-flow: column; align-items: stretch; justify-content: flex-start; gap: 0.125rem;">...</div>

Not urgent, just an optimization for someday.

allanlasser commented 1 day ago

This is a result of using props to control the styles. There may be other ways to achieve this, like deprecating Flex and creating a global .flex class instead.

eyeseast commented 1 day ago

The component is nice to use, but I do wonder if there's an all-CSS way to do the same thing. Something to poke at when things are quiet.

allanlasser commented 1 day ago

Oh yeah, a bunch of conditional classes would be another way to split the difference. I agree that the component has good ergonomics for layouts we're frequently building.