Does alphabetically sorting CSS properties, will give any benefit in GZIP and brotli compression?
2 Answers
Maybe, if it brings repeated words closer together. This is easy to test to get your answer.
I just tried it on the CSS for this very site (stackoverflow), where sorted that CSS compressed to 68K, and after randomly shuffling the directives it compressed with gzip to 88K. So sorting does make a difference. (That CSS is already mostly sorted, so without sorting it compressed to 68K as well.)
No, this is extremely unlikely to provide any impact on your performance. Gzip can properly compress CSS properties that are similar even if they're not in alphabetical order. You're better off investing your time elsewhere.