Top
Best
New

Posted by mpweiher 5 days ago

Pico CSS – Minimal CSS Framework for Semantic HTML(picocss.com)
373 points | 108 comments
poidos 5 days ago|
Love pico. It’s my default starting point for nearly every side project. Sometimes I will reach for Neat [0] which is a great deal smaller.

[0]: https://neat.joeldare.com/

codazoda 5 days ago|
Whoa, that’s mine. Thanks for the mention. :)

I use it for almost everything. I just made a note to try it with the demo and to steal some ideas from pico (while keeping the size of neat tiny).

austinjp 5 days ago|||
Good stuff. And it's lovely to see something inspired by the truly awesome 100 Rabbits.
poidos 5 days ago||||
Thanks for the great tool! Appreciate it. :)
hmsp 5 days ago|||
This is awesome I’m going to start using.
andreashaerter 5 days ago||
Even though I use Tailwind CSS for larger projects, there are smaller, self-contained cases where Pico CSS is a perfect fit. Their "Usage scenarios" page describes it spot on:

https://picocss.com/docs/usage-scenarios

I discovered Pico CSS just last week, and it turned out to be exactly what I needed for a small Hugo theme (govanity, vanity URLs for Go modules/packages with Hugo: https://github.com/foundata/hugo-theme-govanity). From discovering Pico, reading the docs, and integrating it, I was done in about two hours.

One thing that's surprisingly easy to overlook in between: CSS variables: https://picocss.com/docs/css-variables and Colors: https://picocss.com/docs/colors

aiiizzz 5 days ago||
I wish there was picocss but as a set of tailwind @apply rules, so I could use tailwind but have base styles classlessly.
dfee 5 days ago||
- url updated!
nicr_22 5 days ago||
Love love love Pico. It's such a terrific starting point, and easy to tweak into different directions. It's the anti-Tailwind.
j45 5 days ago|
I’m not sure if it’s the anti-Tailwind.

Maybe just a little upstream.

It’s easiest to start with Pico (especially classless) and the make the decision on where to go, when you decide to add classes whether it’s continue with Pico, easily head towards Tailwind, or something else.

Winblows11 5 days ago||
There's also this site which allows easy switching/previewing of classless CSS themes:

https://www.cssbed.com/

simpaticoder 5 days ago||
I like that resource, but it's missing an important one: github-markdown-css[1]. Given that most devs these days read a lot of Github markdown, it seems like a reasonable starting place for a css system.

1 - https://github.com/sindresorhus/github-markdown-css

subless 5 days ago|||
Reminds me of https://csszengarden.com/
rebelpixel 4 days ago||
I've been waiting for someone to mention this just to check how many older designers/devs are here.
giveita 5 days ago|||
Tufte looks very elegant
internetter 5 days ago|||
Tufte frequently makes the rounds here — most recently 4 days ago: https://news.ycombinator.com/item?id=45119103
j45 5 days ago|||
Very clean especially with the Roboto condensed example in the comments of the shared Tufte link.
svat 5 days ago|||
See also https://dohliam.github.io/dropin-minimal-css/ which has quite a few more (including github-markdown-css mentioned in a sibling comment).
j45 5 days ago||
Nice.

There are some nice one there, surprised many weren’t mobile-first or mobile-friendly.

Pico looked nice on mobile though.

luckylion 5 days ago||
I suppose the title should be _Minimalist_ CSS Framework. At 71kb it really isn't minimal.
chrismorgan 5 days ago||
Four years ago I wrote https://news.ycombinator.com/item?id=28860500:

> Not fond of Pico.css’s weight, though: over 50KB, nowhere near as lightweight as the name suggests (even if it’s above-average compressible, 8KB gzipped—but I wouldn’t count even 8KB uncompressed as pico); in this case, if you flatten the variables and strip unused code, you’re left with under 4KB (~1.4KB gzipped). Lots of bloat from unused light mode support, things like form controls, and a fair bit of frivolous custom properties usage. This is the sort of place where I see the appeal of the likes of Tailwind, because they generate such huge amounts of CSS that you just about have to use an unused style remover. But it is another build step, and contrary to the deliberate intent here.

And it sounds like it has grown further. I don’t see 71kb, I see 83KB (11.6KB gzipped, 10.1KB brotli). At that point I wouldn’t even call it small, and it’s even getting past medium-sized into large territory.

kozika 5 days ago|||
There is also a semantic-based CSS that is overwhelmingly smaller than this one: https://newcss.net/

And I think this is so minimal

bdn_ 5 days ago|||
New.css developer here, thanks for sharing :)

I’ve been thinking about creating a CSS tool somewhere about halfway between new.css and Pico CSS for very basic page layout tools (containers, callouts, menu bars, etc) that still focuses on being extremely small and performant.

I feel that a tool like that would be helpful for laying out a simple but functional site (sourcehut’s site [1] comes to mind) where you need a few basic layout tools but don’t need all of Bootstrap.

[1]: https://sourcehut.org/

codazoda 5 days ago|||
I’d love to see NeatCSS on your list. It’s not officially classless but I try to make it semantic as much as possible. I bookmarked you GitHub repo (which you should link on the page if I didn’t miss it). I’ll give it a try myself to see if it works (and maybe make adjustments).
sroerick 5 days ago|||
I think this would be excellent. There's a whole class of websites /landing pages which right now Astro seems to be filling that niche. It's mind boggling how hard it is to do basic components on the web
vehemenz 5 days ago|||
Tailwind is semantic too because the class names say what they do.
imiric 5 days ago||
That's not what semantic means.
user____name 5 days ago||
Stop arguing semantics!
d1sxeyes 5 days ago|||
That’s if you load it all from the CDN though, build your own with SASS and it’s much smaller.
drewbitt 5 days ago|||
I agree. beercss is less than 20kb and about the biggest 'minimal' I would consider
jonahx 5 days ago||
Indeed. I was expecting 5-10Kb. Tbf, it's only 11 zipped.
sixtyj 5 days ago||
At Neat CSS website author says that zipping needs some action at browser side and it is not worth it for small css frameworks…
MrGilbert 5 days ago||
I use picocss for my personal site [1], which I just recently converted to plain html. I just realized that, with a bit of plain vanilla js, I can easily create a header and footer for every page. I need to write some kind of markup anyways, so why not directly write html? Also, picocss comes with dark mode, which I personally prefer.

[1]: https://g5t.de

wishinghand 5 days ago|
If you're using Apache you could just use Server Side Includes and forget the JS.
j45 5 days ago|||
If simplicity is the goal, html can be inserted in other html using the embed or object tag, no JavaScript required.

https://www.w3schools.com/TAGS/tag_embed.asp

https://www.w3schools.com/TAgs/tag_object.asp

MrGilbert 5 days ago|||
That’s a neat idea! I’m using Nginx, but there’s also SSI support in it. Currently, I'm using Javascript to set the current page on the main nav. I might get away with conditional includes or similar. I’ll explore my options. Thank you!
bcardarella 5 days ago||
This is how CSS should be written. I will never understand why class names need to repeat the semantic purpose for a given element.
james_marks 5 days ago|
I think divs sent a generation down the wrong track. It’s weakly semantic and omnipresent in every 101 tutorial; it makes the semantics overall seem weak/insufficient.
lobsterthief 5 days ago|||
It’s just the default block-level containing element, so it serves its place but is not well explained in these tutorials (just as spans are the default inline element).

In my 25 years of experience writing HTML and CSS most engineers don’t understand semantic HTML, nor do they take the time to learn it; largely because companies don’t value it, unless they’re heavily SEO-focused companies.

I once worked at a company that would run an HTML5 validation test in our CI/CD pipeline. That was very helpful as it identified invalidly nested elements and taught proper semantic HTML.

j45 5 days ago|||
I don’t know if it was the wrong track, it was a frame of reference with little before it.

Unless one likes using tables instead or spacer gifs.

It’s nice html has options beyond. divs now too

librasteve 5 days ago||
big fan of pico … just published the new https://raku.org official website using it
notagoodidea 5 days ago||
Congrats on the facelift of raku.org! Interesting to see the mix of HTMX/PicoCSS and Cro.
mpweiher 5 days ago||
That's not a coincidence :-)

Can you explain a bit how you are using HTMX?

Pointer is great if you have it...

librasteve 5 days ago||
The new raku site is built on the https://harcstack.org - that's HTMX, Air, Red and Cro. (The raku Air module is the glue, Red is the ORM and Cro is the HTTP framework).

HTMX and Pico are baked into HARC stack - the rationale for this is that HTMX (as the antidote to React) enables non TypeScript languages on the server side. Of course, then you need a library that will help you write your server! That's where HARC stack comes in.

For example, on the raku.org front page you will see a set of button/tabs that select specific code examples - each one of these does...

  <li class="active">
  <a hx-target="#buttabs-1-content" hx-get="/buttabs/1/multi-paradigm" data-value="1">multi-paradigm</a></li>
These results in a more lightweight page and the ability to run code to render the tab content on demand. It's probably overkill for this site rather static needs, but the Air::Base component library tilts towards active HTMX controls wherever possible.

hth

dang 5 days ago||
Related. Others?

Tailwind CSS vs. Pico CSS (2022) - https://news.ycombinator.com/item?id=41511420 - Sept 2024 (48 comments)

Htmx, Raku and Pico CSS - https://news.ycombinator.com/item?id=41482679 - Sept 2024 (153 comments)

Pico CSS v2 comes with 380 manually crafted colors - https://news.ycombinator.com/item?id=39488979 - Feb 2024 (12 comments)

Pico CSS Framework - https://news.ycombinator.com/item?id=29559961 - Dec 2021 (101 comments)

codedokode 5 days ago|
The buttons and form inputs are too large compared to standard desktop UI elements.
bityard 5 days ago|
Yeah. I had to zoom out to 75% in my browser before the text looked normal-ish sized but the "widgets" still looked very big and awkward. Maybe this was designed not just for mobile-first but mobile-only?
pikelet 5 days ago|||
Looking at the CSS variables page it seems that this is because they scale up the base font size at various breakpoints, starting at 106.25% at 576px, and going all the way up to 131.25% at 1536px. It definitely feels too heavy handed to me. The first time I viewed the website on mobile it seemed fine (because it's actually at or close to the browser's standard font size) so I wasn't sure what the problem was until I viewed it on my desktop. I can kind of see what they're going for as it keeps the layout fairly consistent, but I don't think it's the right approach.
librasteve 5 days ago|||
I agree, but quite easy to scale back with a couple of root values
More comments...