aanckar / react-pdf-tailwind

Use Tailwind CSS to style PDFs created with react-pdf
315 stars 11 forks source link

The flex property doesn't work as expected #3

Closed MarkAlexanderDev closed 1 year ago

MarkAlexanderDev commented 1 year ago

The "flex" property in tailwind is supposed to give the row layout by default, with this package, we have to extra specify "flex-row" property to have the row layout.

chrissantamaria commented 1 year ago

From what I can tell, this behavior comes from react-pdf itself, not react-pdf-tailwind - this package is just responsible for converting Tailwind-style strings to style objects. Though I agree row being the default makes sense, imo it shouldn't be handled in this package.

aanckar commented 1 year ago

This is because react-pdf uses yoga under the hood, which uses some defaults that differ from the web standard (flex-direction defaulting to column being one of them). I think I'll follow these "quirks" for now in this package as well, rather than overriding them, as other tailwind wrappers for yoga based layouts (like NativeWind for React Native) do the same.