DEV Community

Discussion on: Classless CSS Isn't Trashy

Collapse
 
jakobbouchard profile image
Jakob Bouchard

While I don’t necessarily use classless CSS on my whole website, my new portfolio’s projects and blog sections will be using Tailwind’s Typography plugin and its prose class, which makes use of classless CSS. I have to say, I absolutely love it. I just apply the class, and boom! The posts looks great!

Collapse
 
nbhankes profile image
Nathan B Hankes

Thanks for sharing. I haven't tried Tailwind yet, but thought it was similar to Bootstrap. From what I understood, Tailwind styles apply to your HTML where ever you use the Tailwind classes.

Classless CSS is different in that it doesn't even require this. The stylesheet would apply a typography style directly to the p or h1 elements, things like responsive text sizing, centered text, etc. So there's no need to memorize or add classes.

The classless CSS stylesheet is basically like a theme template if that makes sense. Just link it to your HTML and voila!

Here's a link to a demo website for the Water CSS stylesheet to see a classless stylesheet in action:

Water CSS

Collapse
 
jakobbouchard profile image
Jakob Bouchard

Classless CSS sounds pretty fun to do yeah! I feel like bigger websites might not be able to use it though. I might try building a complete-ish website using it 🤔
By the way, I also thought Tailwind was similar to Bootstrap, but it’s really not. Especially if you use its PostCSS features, as you can @apply their classes to elements or other classes:

h1 {
  @apply text-white mb-4;
}
Enter fullscreen mode Exit fullscreen mode

I had a much better time with Tailwind than Bootstrap personally. I will try out classless for sure though!

Thread Thread
 
nbhankes profile image
Nathan B Hankes

That @apply functionality is pretty slick! Thanks for letting me know about that.

And have fun with classless CSS!