Syntax Video
CSS Without Classes! Styled Apps By Default
Intro
Sometimes when I'm working on a new app or prototype, I don't want to have to worry about CSS at all. A lot of times I just want it to be styled by default. And this is where classless CSS frameworks come in. They're essentially a CSS file that you can drop into your app and it automatically styles all of the standard elements that you might come across in HTML. In this video, I'm going to show you some of my favorite classless CSS frameworks and also show you a tool I built to compare all of these frameworks so you can decide which one you might want to use in your next project. If that sounds good, let's dive in. My name is CJ. Welcome to Syntax.
What is it?
Now, first up, if you've never heard of classless CSS framework, let me show you some examples of what it entails. And I'm going to show you with Pico CSS, which is probably one of the most popular classless CSS frameworks. and I've been using it for years at this point. So basically all you have to do is add their CSS file whether it's from a CDN or whether it's from npm and then everything in your site is automatically styled. For instance, if you take a look at buttons, if you have an HTML button on your web page, it's automatically going to look like this nice blue button. Similarly, if you have any tables on your site, they're automatically going to be styled like this. And also forms. So you can get this really great looking form literally just by having form field sets and labels. You can see there's no classes specified here. Everything is styled by default. So that's what a classless CSS framework gives you. And when would you want to use something like this? Now typically I use it for like one-off projects, prototypes, maybe something that I'm like vibe coding or spinning up with AI and I don't want it to have to
When? / Why?
worry about styles. If you use a classless CSS framework, you can just tell AI to use semantic HTML elements or just use h semantic HTML elements if you're not using AI and your site is automatically going to be styled. You don't have to worry about that piece of your app. Now, this isn't for every app. Obviously, if you're building apps for customers or maybe something for a company that needs custom design to and it needs to look bit a little bit more unique for your brand, you definitely wouldn't want to use a classless CSS framework in those cases. But for the type of work I do and a lot of the the apps that I build, a classless CSS framework is perfect for that. Now classless is relative because Pico also provides classes. They have a classless version, but you can see that there are also variants. So you can get these base stylings by default, but they also offer up a few extra classes you can use if you want to get some slightly different styles for your buttons. They also have like outline buttons and stuff like that. So some of these class list frameworks provide classes as well but
When NOT!?
you technically can use them without classes. Now another thing I like about using semantic elements is you can get things like an accordion. So in classic accordion style you have some text here and then when you expand it you can see the summary. So if you're using HTML you can use a detail summary element. So literally just by having a detail summary element you automatically get a nicely styled accordion on your site.
Pico.css
And one other thing I like about Pico, which maybe only one or two other classless CSS frameworks do, is they give you the ability to have cards. So this is standard in a lot of apps and CSS frameworks, is the ability to have some rectangular thing that's separated from the background. And in Pico, if you put your content inside of an article element, that's automatically going to appear as a card. And you can also use semantic elements like header and footer, and that's going to add the header and footer sections within your app. So, this is a showcase of Pico, but I'm also just kind of showing you how these classless CSS frameworks work because they're basically all this. You essentially use semantic elements and they get styled by default. So, let's take a look at a few others and then I'll show you how we can compare all these classless CSS frameworks to choose the one we want because I've actually come across 69 different classless CSS frameworks and those are just the ones that style things by default. There's a bunch of others that require some classes, so I didn't include them in the list, but yeah, there's 69 of them, so
there's a lot to choose from. Here are a few highlights. This next one to look at is water CSS, and they too support a dark theme and a light theme. So, I didn't show this with Pico CSS, but it automatically detects your preferred preference, whether you like dark mode or light mode, and styles things accordingly. So all of these ones I'm going to show you do that because that's for me that's a bare minimum thing that I want in a classless CSS framework is dark mode and light mode automatically.
Water.css
Water CSS has this as well. It's a whole lot smaller. So it's under 2 kilobytes when it's minified in gzipped. And uh you can see what this looks like. Now I'm not going to have a whole lot to say cuz style is subjective. Basically for any one of these classless CSS frameworks you're just going to have to take a look at it and decide if you like how they style things. Another one to look at is concrete CSS. I like how plain and minimal this one is. There's it's just like no distractions. It's just white and black and there's no rounded corners. Everything's just nice and rectangular. So, concrete CSS is another cool one to look at. CSS, which I discovered when I was building this tool and making this video uh because it's it's pretty nice. Um I like their dark theme just a little bit more than Pico CSS and it's pretty minimal. Um they don't have like button variants or anything like that, but the base styling for for buttons looks looks decent to me. And then another one that I recently came across is called Matcha CSS. And they have a lot a ton. If you take a look at their demo site, you can see all the stuff that they're demonstrating,
concrete.css
bolt.css
matcha.css
but it also looks very nice according to my preferences in terms of style. I like their cards. Um, I like the the dark and light colors that they've chosen. So, Matcha CSS is pretty great. Now, these are just a few in the vast vast sea of classless CSS frameworks that are out there. And there is this repo called classless CSS by uh D Boddan which I used as a source for my tool. So thank you very much to this repo. But if you check out this repo, they actually have a ton of classless CSS frameworks listed here and they have screenshots of each one with what's known as a kitchen sync.
More Classless CSS Frameworks
You might see this term in a lot of these classless CSS frameworks. A kitchen sync example basically has all the things that you might want to see. So it's got forms, it's got images, it's got typography. That's the kitchen sync. All of that together. And you can see the screenshots of each of these classless CSS frameworks here. So I used their list as a source and I built a site where you can basically plug in some HTML and see that HTML rendered across 69 different classless CSS frameworks. So at a glance you can start to decide if that is the framework that you want to use. So here you can see I've got a button and then down below all of these are being rendered inside of frames. So the styles are isolated and you can see how each of these class list CSS frameworks renders out these buttons. There's a few other examples you can choose from like a checkbox. You can see how that gets rendered out. And uh you can play around with how wide or small they are. And I also have a kitchen sink example. So if you choose this, you can see how each one of these things renders a bunch of stuff. You can
Preview Tool
see all of these examples for each of these uh classless CSS frameworks at a glance. One other thing I did is I went through and found all of the classes CSS frameworks that have automatic light mode and dark mode because again like I mentioned at the beginning, that's one of the things that I care about. Uh so if you filter by that, you will be able to see the ones that support it. And this lets you see at a glance if you like the styles of any one of these classless CSS frameworks. Of course, you can also filter by name. Uh you can sort alphabetically. Basically, this just allows you to find the one that you want. And like I mentioned for this app, I actually discovered Bolt CSS and that's what I used. But I think for future apps, I might even use concrete CSS. I just like how low distraction this is. It's just black and white.
Nothing crazy. Sometimes that's that's what you want for an app. Okay, so this is what classes CSS is. Let me know down in the comments if you're using any one of these. Let me know if you're going to use my tool and maybe if you discovered one that you'll be using in the future. And uh that's all I got. So I'll see you in the next one.
Thanks!
Quote it with credit and a link. Quoting Syntax