3 ms·
Yeah, I would say using components (rather than classes with @apply, as another commenter said) is the main thing. The class clutter is then contained to that c
by dcre 3y ago
Yeah, I would say using components (rather than classes with @apply, as another commenter said) is the main thing. The class clutter is then contained to that component. You make some components and then in most of your code there are only a few classes here and there.
Here's an example from my main work app:
Components: https://github.com/oxidecomputer/console/blob/da07ce01a8fb7fe69c3ed35733a7e7fb2f268ba0/app/components/Sidebar.tsx https://github.com/oxidecomputer/console/blob/da07ce01a8fb7f...
Clean call site: https://github.com/oxidecomputer/console/blob/da07ce01a8fb7fe69c3ed35733a7e7fb2f268ba0/app/layouts/ProjectLayout.tsx https://github.com/oxidecomputer/console/blob/da07ce01a8fb7f...