r/webdev • • 22d ago

Showoff Saturday modest-ui: classless CSS that styles plain HTML

I’ve been building websites for over a decade, and have always tried to do things as vanilla as possible (where applicable).

More recently whilst building components and looking at the libraries out there, I realised that browser technology and CSS has grown to a point where it can do the majority of things we need, without JS (like dialog, detail, and popover tags)

So I started working on modest-ui as a CSS base for all my personal and side projects, and as it’s gotten more stable I’ve recently bumped it to v2.

It’s themeable with CSS vars, can be used as an unobtrusive base layer to built on top of, and can either be used classless (with mdst-ui set on the body) or you can pick and choose classes as needed.

Anyway, it’s open source (MIT), no JS (except for some examples on the site), and currently sits at about 10 kb (gzipped).

https://github.com/thisismodest/modest-ui
https://modest-ui.com

Edit: I forgot to mention it’s ~10kb when gzipped

105 Upvotes

32 comments sorted by

View all comments

9

u/lekoalabe 22d ago

Interesting! On my own framework I dropped the "classless" part because having to add the where(scope class) everywhere drove me crazy. I'm not sure it's worth it. Adding a few class to your HTML feels like a sane default. And a simple "button" almost never happens it has a variant etc so saving a btn class doesn't seem worth it. And having a prefix for all classes isn't worth it either IMHO in most cases.

4

u/_squirts 22d ago

I know what you mean about the where()s. This started out class-based but it was starting to feel very verbose and more like bootstrap/tailwind. That’s the main reason I opted to move it to classless, but more as a reset layer so I can theme the vars and add more specific styles on top