There is a strange issue in 2.4 beta 3 (but I think this was in earlier ones too) where the CSS style property changes ordering based on when it was last edited, rather than any kind of logical ordering such as alphabetical.
See the image below. If I were to clear and set the font-family in the UI, when I then go to the CSS tab of the element, the font-family will then be at the bottom of the list instead.
Is this expected behaviour? It seems like it shouldn’t be, and should be alphabetized or something logical, that way things like font-related items can be together, colours together, flex-related styling together, etc. Otherwise resetting a property and setting it again to the same value moves the change to the bottom and in a heavily customized property it can look like it was missed because it’s no longer in the place that one might expect to see it (I think most people would expect it alphabetical but perhaps there’s a better sorting manner to use).
Hi Dustin,
At the moment, the generated CSS order can follow the order in which the underlying settings are stored or updated, so clearing and setting font-family again can move that declaration lower in the CSS panel. A predictable sort order could be useful, but the exact behavior needs to be decided carefully because alphabetical sorting is not always the best order for related CSS declarations.
For example, not all flex-related properties start with “f”. We need to see if this is a potential improvement for other users as well.
Understood, of course not all CSS styling declarations are named in groups, although many are. I guess the takeaway I hope you have is that any sorting would be better than it currently behaves for most people, because generally when viewing CSS many people would expect to quickly scan for the right one alphabetically. Right now it doesn’t behave in a predictable manner at all, and I’m sure the vast majority of users would say that any kind of predicable sorting would be better than none.
Maybe offering options (to be set in Settings perhaps) would be ideal so users can choose the way it behaves best for them.
I haven’t seen a css file written in order myself. So doesn’t make much sense to me that much, and this would add extra cpu cycles for what I think is not a standard or in practice. Little things adds up. But sure, if there is an option in settings for those who want it.
My main concern is simply that the current order changes unpredictably during editing. A stable, deterministic order, whether based on Bricks’ control order or something else, would make the CSS much easier to scan without necessarily requiring alphabetical sorting or another setting. My vote goes to alphabetic, but as long as there’s some sort order logic in place beyond what’s currently being used, anything else is still better than what we currently have IMO where anytime a change is made the affected one moves to the bottom of the list.
FWIW, I don’t think CPU cycles is really a concern here at all, if anything it will be sure negligible / unnoticeable.