Sent on Feb 16, 2023

How camel-cased classes are better than kebab-cases ones

While working on Magical Dev School, I discovered that camel-cased classes are MUCH better than kebab-cased classes.

Before you label me as a JavaScript dude who’s trying to make CSS more like JavaScript, hear me out:

  • I started my career more as a CSS guy than a JavaScript guy.
  • I love CSS and I have no intention to deface CSS, so I’m not coming from a point where CSS sucks.
  • I simply love to improve systems and this is one way I’m improving the systems that I use.

I’m just sharing this with you today because I truly feel that camel-cased classes are better than the traditional kebab-cased classes — especially when you’re trying to write modular CSS.

That’s because:

  • It’s much easier to name things in camel case
  • Camel cased classes are much easier to read and understand

I like this so much that I came up with a new system for writing CSS. It’s build upon the traditional BEM method (Block, Element, Modifier) but with huge improvements.

I call it CamelCSS.

In case you don’t know what BEM is, BEM is a method for naming CSS classes that has been very popular in the past 10 years. I wrote extensively about BEM in this article if you need to get up to speed.

Now let’s shift our attention back to CamelCSS because it’s much better than BEM. If it wasn’t, I wouldn’t be writing this email to tell you about it today!.

Long story short, CamelCSS has the following benefits over BEM:

  • It’s much easier to name things with CamelCSS
  • HTML and CSS written with CamelCSS is much more readable — and therefore easier to understand. (Unlike BEM, it doesn’t hinder your cognition ability. It simply gets out of your way so you can get your job done super fast).
  • We waste lesser brainpower switching between Component and Class names (useful if you work with framewolks like React, Vue, Svelte, etc).
  • CamelCSS is much more extendable than BEM, so you can add utilities, icons, containers, and other words you deem necessary to make your classes easier to understand.
  • CamelCSS is super composable — so you can write and compose classes!

Here’s the article about CamelCSS.

I hope this methodology brings a smile back to your face as you write CSS — just like it brought a smile back to mine.

Stay awesome,
Zell

P.S. Magical Dev School is ready — check it out if you wanna become an amazing developer who can build anything you want from scratch in 30 days or less

P.P.S. I figured out how to setup Google Analytics, Google Ads, Google Tag Manager, and link them al up together (including setting up custom events like a purchase).

I thought about making a quick course on this for developers so you can be more employable for freelance and other job opportunities — that because advertisement and analytics contribute a lot to a successful business.

Would you be interested in it? If yes, reply and let me know! (Just sounding out interest before I commit this into the roadmap for Magical Dev School).