Open istarkov opened 1 year ago
Some thoughts here:
The need for cleaning up unused properties when a property they depended on has been removed, but:
What happens if you set the properties in flex mode, but allow overrides to set the display value? (future possibility)
What if your component is used in external code and it's used with both display: block and display flex, depending on some other logic?
Overall it seems dangerous to automate this cleaning. It has to be controlled by the user somehow. Should we warn them somehow?
Maybe we need a separate feature, entirely independent: styles checker. It could check for potential useless properties, but instead of removing them, just warn and show where to find them. It could check for accessibility issues. It could check for potential performance issues etc.
Examples: If you change
display: flex
todisplay: block
all flex CSS properties become useless i.ealign-items, justify-content, flex-direction, etc ...
align-content
has no sense (in the flex model) in case offlex-wrap
is set tonowrap
display: grid
has its own bunch of properties.Probably from a UX perspective, it's not that bad that the system preserves the state of properties I set. But on the production site, I don't want "useless" CSS properties.
Not a big issue as these properties should not affect anything (but remember
gap
it didn't work with flex but now is).