Abbreviated styling props are fun to write, not fun to read.
256hz opened this issue · comments
I just spent more time than I'd like to admit searching for what turned out to be this:
my='l'
This allows for too much obfuscation in my opinion.
- The property name is not standard CSS or camel-cased CSS (React Native)
- The property name is a valid English word that results in false positives when searching
- The pixel amount isn't directly searchable (not the fault of the abbreviation, but is already a layer of obfuscation)
- Using a formatter like Prettier can result in a bunch of these being on one line, hiding them visually
- The time our developer saved writing this is orders of magnitude lower than the time I wasted looking for it
If inline styling is really important to your workflow (why?), I believe future developers should be able to find your styling with common style keywords.
Thanks for reading my rant. All the best.
When using createBox or createText devs can opt-out from shorthands using generics, and when creating your own restyle components it's up to devs to decide to use shorthands or not.