hyperfocalHQ/pollen

[RFC] Make colour palette an optional addon

madeleineostoja opened this issue · 2 comments

While Pollen isn't exactly a heavy library, I don't like the idea of deadweight in a codebase. The colour palette is both the heaviest part of the library (0.4kb gzip) and the least likely to be used as a project matures and leaves prototyping, since most projects end up with their own custom colour palette.

We could split the library into a core with addons, as separate CSS files. Pollen core (typography, layout, and UI) would then be 0.9kb (and can tout being "under 1kb"), and you could easily eject colours once you're done prototyping and have a custom palette.

Could even split every module into its own file, but that seems excessive. Colours stand out to me as something that may not belong in a long-lived design system foundation, the rest feels quite foundational.

This is a pattern that would allow new, less-core variables to be added as addons later too. Something like some tailwind-style grid template defaults comes to mind.

Pretty sold on this, build changes are already in master

Also adding an optional grid addon, with template shorthands similar to Tailwind, and a configurable page container grid that I think is pretty neat.