Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1264: small devx changes for css / tailwind tooling r=theoephraim a=theoephraim did some digging into latest tooling and best practices for tailwind/css/etc. Hopefully these small quality of life improvements will help make things easier and keep things tidy. - main tool is https://github.com/lukeed/clsx - secondary is using a (noop) [string template tag function](https://www.freecodecamp.org/news/a-quick-introduction-to-tagged-template-literals-2a07fd54bc1d/) with IDE settings to get autocomplete on class lists outside of the template tag Some quick guidelines on tailwind classes: - try to keep tailwind classes in the template _as much as possible_ - feel free to use clsx even when seems unnecessary as it will make adding more classes easier later - break up super long lists of classes into multiple lines, grouping things as appropriate (ex: static classes, dark mode, toggles based on state, etc) - dont copy paste classes if used multiple times in component, move to script as static var or computed (if dynamic) and use `clsx` and `tw` helpers - its OK to also add semantic classes with BEM-ish naming if it might be helpful in debugging what html belongs to which component - we may fall back to using css occasionally where it makes sense, but it should be very rare Co-authored-by: Theo Ephraim <theo@systeminit.com>
- Loading branch information