Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Modular CSS with Sass!
You have completed Modular CSS with Sass!
Preview
Using Sass' ability to generate BEM selectors with &-suffix naming conventions, let's create a handy mixin for writing BEM selectors!
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
generate BEM selectors with an ampersand
and a suffix, let's take things a step
0:00
further by creating a mixin that makes
writing BEM selectors a little easier.
0:01
So we'll go over to the utilities partial.
0:07
And at the bottom of the file, we should
see this comment for BEM selectors.
0:10
So first, we'll create a mixin for styling
elements inside a block.
0:15
So, let's say, @mixin and we'll call it e
for element.
0:20
Then, we'll need to pass the element
selector name as the argument.
0:29
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up