CSS BEM methodology: what about page specific styles?
almost 8 years ago from Francesco Bonomi, Front-end designer @ 3D Hubs
Hey DN,
it's been a few months since I adopted the BEM methodology to develop my project. I found it to be a great way to keep your CSS organised and structured and it really helps you think about the components that a website is made of. I still work quite slowly with BEM, because it requires you to think clever ways to name your blocks and it's not always easy.
Now, every time I have to work on a landing page that could have its specific styles (maybe even just a background color) I don't know where I should put these rules.
TL;DR Example: Let's say I have a block called section with just some padding applied to it, but just on a single page of the website the background has to be blue.
Following BEM methodology where would you put these styles? Creating a modifier of the block doesn't really work for me... What about you guys? I'm sure that someone of this great community has a good answer :) Thanks in advance!
Login to Comment
You'll need to log in before you can leave a comment.
LoginRegister Today
New accounts can leave comments immediately, and gain full permissions after one week.
Register now