Top
Best
New

Posted by mpweiher 6 days ago

Pico CSS – Minimal CSS Framework for Semantic HTML(picocss.com)
374 points | 108 commentspage 3
stgr_codes 6 days ago|
Really love how this project is evolving. It helps you write components with better accessibility without compromising maintainability (it actually improves it) and it's easy to customize.
rodolphoarruda 6 days ago||
Pico is great! It's nice to see it hitting HN front page.
rimmontrieu 6 days ago||
I use tailwind but sometime extremely lightweight CSS framework like Pico is a good starting point to build the foundation for any projects.
euroderf 5 days ago||
OT-ish but, can someone point me to a minimal framework that does collapsible trees ?
lobsterthief 5 days ago||
You will need to write custom CSS, but collapsible trees are totally possible to do purely in CSS in any framework via a simple combination of checkboxes, labels, pseudo-classes and CSS combinators.

The `:checked` selector allows you to target checkboxes that are checked. So you can have a set of checkboxes (off screen with an absolute negative position or similar) that are controlled via a <label> element that wraps the + or - text in the tree. Then based on its state, you can target elements directly afterward to be expanded or contracted using the CSS adjacent sibling combinator.

Checkboxes are neat because they provide state management natively in the DOM and you can do a lot via CSS based on that ;) Thus, you have pure HTML and CSS collapsible trees.

clarkdale 5 days ago||
98.css has this with the details html element
indigodaddy 6 days ago||
FastHTML uses Pico CSS by default
ixxie 5 days ago||
I love the idea, but why can't I install with npm and import as plain CSS?
Leftium 3 days ago|
https://picocss.com/docs#install-with-npm

    npm install @picocss/pico
All the built/minified CSS is distributed in the package, too:

https://www.npmjs.com/package/@picocss/pico?activeTab=code

potato-peeler 5 days ago||
Does not work in older browsers, iOS 13.6

Strangely latest bootstrap works just fine.

tcdent 6 days ago||
yeah but does claude know how to use it?
minimaxir 6 days ago||
LLMs may know the v1 version of PicoCSS, which has some differences from the current v2 (e.g. no SASS).
lagniappe 6 days ago|||
Claude knows how to use plain HTML.
mariocesar 6 days ago|||
Yes it does
dalemhurley 6 days ago||
agents.md will help if it doesn't
keysdev 5 days ago||
How does this compare to pure css?
IgorPartola 6 days ago|
I honestly can no longer tell which “minimal CSS frameworks for semantic HTML” I have not seen on the front page of HN and which are repeats. Are they all the same at this point?

Not specifically picking on this one, just that it seems that they are the quick to crank out type of libraries and everyone has their own.

Retr0id 6 days ago|
The neat thing about semantic HTML is that the CSS ought to be pretty interchangeable.
IgorPartola 6 days ago|||
Sure but why would I do that? When was the last time you decided that the solution to whatever problem you were facing was to switch to a completely different CSS framework without rewriting your HTML?
eternityforest 4 days ago|||
For entertainment related stuff where you want really deep themability, a lot of popular frameworks seem to rely too much on non semantic classes that make it hard.
turkey99 5 days ago||||
I’ve had this scenario several times.

The last was when the company I worked for was acquired. We needed to adopt their CSS library for all our applications.

I changed their component based library to have semantic style css and dropped it right in.

giveita 6 days ago|||
The real neat thing is not having to make decisions up front. But you can tweak it later. If you are a rebel you could even use classes to touch up bits you are not happy with.
IgorPartola 6 days ago||
What I am saying is that I have never done this, have seen the need for this, or have heard of anyone doing this or having the need for this.

To create an absurdist analogy it is like saying that because labels on cotton T-shirts are the same size that you could take them off shirt A and sew them onto shirt B. It is possible by there is zero point in doing it other than to say that you did it.

giveita 5 days ago||
Correct, there is no need. It is more of a preference, maybe a challenge or code golf type of thing. One advantage is less thinking / decision / boilerplate is needed when adding elements.

Semantic:

p

Normal:

p class=paragraph

Utility:

p class=mx-1 py-1 my-2 text-medium

It is like buying a medium shirt rather than getting a tailor-made t-shirt.

vehemenz 6 days ago|||
You're mixing "is" and "ought." Why ought styles be interchangeable (remembering that stylesheets and DOM structures often have complex, dependent relationships that are rarely as simple as Pico or anything similar).
Retr0id 6 days ago||
I said what I meant to say, I don't understand your reply.