Alvin Novian
Back to index

A Retrospective using BEM SASS

Ohh man, another CSS article in the Internet, but why? isn’t CSS seems easy? well, it’s not. I think I get it why people tend to think CSS is easy, because they build something that’s not scalable or they build something that mainstream, something that’s not unique, I mean if you build a Web App that rely on Material Design System, the chance are you are using Material UI, so we can just drop-in the available Component or they are using Bootstrap so that it’s just the matter of slapping proper class name to the HTML tag, and probably write CSS only for a slight customization.

Fair enough, but what if you build a Web App with your own design system, maybe you’re building a game, an attractive company profile that has unique layout, interactivity and so on, or others. And it have to be maintain for a long time, while adding a new feature every single day. In this case you have to be well-prepare. I work for Frisseblikken, where we build a lot of gamification, so every single of that ingredient exist. Every project has it own design style, unique interactivity, … yada yada yada.

I have tried a lot of CSS paradigm in my entire career as a Front-End Developer, so why I choose BEM SASS. Here’s my insight:

The Pros

first, let’s talk about the pros of using BEM approach

Modular structure

This make thing easier to track, because every Element is tied to a Block, which is also make it easy to manage the state even if we don’t use Component framework like React in the Front-End.

For example: …

Totally separated from HTML structure

Unlike other approach that are using the ability of CSS to Cascade the Style (which actually that’s what CSS stands for, Cascading StyleSheet), BEM

still draft …