3 ms·
Ask HN: Semantic” CSS Framework?
When I make applications on my own account that are server-side rendered I frequently use CSS to style things in a way similar to what I think CSS was intended for initially, that is, I apply styles to meaningful parts of the document (e.g. "div.statusbar", "table.postlisting th".)
Frequently I work on these things on and off for months or years and eventually they become a hot mess.
I'm looking for something that will help me have some discipline. I do not like BEM, Tailwind CSS, Bootstrap, and other frameworks that want to impose alien structures on CSS. I like the intention of SASS/SCSS but don't like the idea of complicating my build system. (I like the idea of CSS Nesting as it works in Chrome but Firefox doesn't have it yet unfortunately. I want to use the latest features but I need support for Firefox and Mobile Safari with Chrome as a distant third.) I would consider using a JS polyfill and I am using jinja2 template so anything I can bake into my python back end (maybe compile & cache compiled CSS) would be possible.
Any advice for frameworks or other organizing principles?
- transfire 4y agoConstraint based style sheets? https://gss.github.io/guides/ccss https://gss.github.io/guides/ccss I think this has great potential and I have been meaning to try it myself although I find the syntax somewhat wanting.
- PaulHoule 4y agoFor something in the "mobile app" territory this seems great. I have one application that is a photo viewer that does a lot of math in an event handler to figure dimensions out to make everything fit perfectly on the screen across a wide range of devices (from PC w/ 4K screen to a bottom barrel Android phone.) It fills in sizes and positions into CSS variables. It works pretty well, but CCSS looks like it could do all or most of that that system does declaratively.