Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Modular CSS with Sass Getting Modular with Mixins and Functions The Project Config File

Why is he using underscore for is $base__font-size and not hyphen like that "base--font-size" at 08:41 minutes, Thanks

Is there any particular reason ?

2 Answers

David Moorhead
David Moorhead
18,005 Points

Hello, maxime daraize,

Yes, there is a particular reason: The two underscores, as well as two hyphens, are part of BEM methodology. The syntax would look like this:

.BLOCK{__ELEMENT[--MODIFIER]}

BEM stands for Block-Element-Modifier and is designed to help modularise frontend development by breaking everything into blocks containing elements, then using modifiers to tweak them.

If you wish to read a whole lot more about it, here's the page.

Hope that answers your "Why" question. :smile:

David