Hacker News new | ask | show | jobs
by robertoandred 1418 days ago
Shifting to a combination of rolling our own and using headless component libraries, which focus strictly on functionality and let you handle all styling. So much of the original bloat comes from the libraries' built-in styles that you then have to override creating a mess of styles; this is totally avoided with headless libraries.
2 comments

That matches my experience working with component libraries. Great to throw something together that looks like Bootstrap or MaterialUI, horrible when you have a designer on staff who wants the site to look like something :-)

How've you found the experience so far? IME, making good components that handle everything you'd expect (keyboard shortcuts, a11y, responsiveness, various CSS contexts) is more complicated than you'd expect, so the codebase gets filled with half-assed and duplicated components that don't work that well. Do headless components (never used them) help that significantly?

Yup, headless components/libraries are perfect for keyboard, a11y, focus handling, state handling, etc. Usually they don't render anything at all, they just give you html attributes, event handlers, etc that you apply to your own markup. This way you can let these battle-tested libraries handle the hard stuff and you can focus on what's actually unique to your project, usually just styling.
Not to shamelessly plug, but if you check what I’m working on in my profile it should be relevant. Mostly headless, dramatically more modern, and focused on performance.