You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What problem does this solve or what need does it fill?
At the moment, the Style struct contains both properties common to all layout options (e.g., margin), but also specific ones to Flexbox, Grid, etc. This feels wrong to me, as it consumes extra memory that is not needed (if I'm not mistaken, the Flexbox properties do not make sense when using a Grid layout).
What solution would you like?
The layout-specific properties could be stored inside inner structs specific to each variant of the Display enum. This would possibly allow to keep each of these inner structs in their own modules, reducing the amount of #[cfg(feature = "...")] needed inside the style top module.
What alternative(s) have you considered?
The current approach can be kept, it doesn't hurt, it just uses a bit of extra memory and makes the Style struct quite big.
Additional context
I am considering using taffy for my own GUI framework, to be open sourced one day if/when it exists enough.