39 comments

[ 3.1 ms ] story [ 81.9 ms ] thread
After seeing so many classless css libraries pop up over the past few years I decided to make my own. Nothing too fancy with it but I like the style and will be using it on some other small projects. Open to feedback or opinions.
From a quick look it's nice but I think the grey background color for the inputs is not a good choice, it gives the impression that they are disabled.
What is the value of a classless CSS system?
Places where you want to auto-generate html reports or do simple data processing into html and not fuss over basic inline styles.

I have a few internal tools that use https://newcss.net/ and it is just a nice tool to have in your quiver.

Extremely simple static site generation (like Grandma used to bake in the 90s web). Either by hand with minimalist HTML or just taking the output directly from almost any Markdown/reStructuredText/Asciidoc/etc processor and generally only needing to add a single LINK tag at the top to one of these CSS files.
you can switch between them without altering the html
Easy to toss on content like markdown or straight out of a CMS and get nice looking pages vs. the default browser styles (that look like 1996).
These keep popping up again and again but are "generally" a terrible idea. At some point you'll need something that you imagined would for sure have an HTML tag and then the misery begins.
What misery? It's not like using something like this means you can only use these styles. It would be very easy to build on this.
For something like a personal website or blog this seems totally sufficient, though maybe a bit boring. I disagree that these kinds of projects are "generally a terrible idea."
Looks decent, pretty minimalistic.

The form / input styles should use :focus-within instead of :hover to apply styles, using "power-user" keyboard navigation with tab and such doesn't correctly show what you have focused. I was pretty surprised by this - it's sloppy to add new input styles that give less information than the default browser styles about what is focused

Textarea removing the little "resize" widget in the bottom left is also pretty disappointing, being able to resize textareas so they're massive when you're typing in them and small when you're done with them is very convenient. For instance check out the comment box on HN, the small angled lines in the bottom right let you resize the box. I understand it can sometimes break layouts but it's not a good reason to remove it.

It's good you have used CSS vars for lots of configuration but I find the choices of 7px and 11px for (highlight-)border-radius to be strange, usually powers of 2 are all the rage these days

Inline text blocks look clean, I like those a lot

These are all great points and I will plan to address them
A "classless CSS library" is just a stylesheet, isn't it?
(comment deleted)
Classless as in the library only uses element and pseudo selectors, no `.class` selectors.
But it's not really a library... just a stylesheet?
Overwriting blue links with...blue links that fail WCAG2 and have no pseudo-classes.

Replacing the default down arrow in <details> with...a down arrow SVG.

Delete it from the page and the main changes are 1. no rounded corners 2. content can possibly be larger than 800px

What's the point of this "library?"

> Use it in other projects

That's the place not to use this. This is just "I think browser defaults should look like this." Use it in any other project and all these element-based rules have a different specificity than the class-based ones. Have fun!

Additionally: form fields are styled to look disabled.
The links have a contrast ratio of 5.58:1. Perhaps that isn't the highest but it's AA and doesn't completely fail.
They fail WCAG2 AA for "Normal Text" contrast at a ratio of 3.46:1 (#4589EE over #FFF).
(comment deleted)
Your styles for <mark> and <code> don’t look good when the element breaks across multiple lines. Thankfully there’s an easy fix, the relatively unknown {box-decoration-break: clone;}
This looks great on mobile Safari. Overflow-y scrolling inside the code block is a great touch. In fact the only real issue I see is the very last element, the range slider, for which the handles don’t fully reach either edge. Awesome job.
Maybe it was just in the German speaking world, but such projects were called "template" or "boilerplate" ~10 years ago. When did we start calling them libraries? It doesn't add any functionality as one might expect from a library, it 's just an opinionated change to the default CSS shipped by browsers. Not to say that this is a bad thing, I just disagree on the terminology.
I think I’m going to switch to calling it a stylesheet because that’s exactly what it is.
The range/output that display 0 or 100 but don't touch the ends of the slide rubs me in a very wrong way. Besides, nice style.
TIL about <mark>, <meter>, and <progress>!
(I'm using MVP.css for my homepage)

Shouldn't have HTML a decent look out of the box?

Finally we're reaching CSS communism