From the course: Sass Essential Training

Unlock the full course today

Join today to access over 24,100 courses taught by industry experts.

Placeholder selectors

Placeholder selectors - Sass Tutorial

From the course: Sass Essential Training

Placeholder selectors

“

- [Instructor] Sometimes you may want to create a class that is not something that you want to compile, but only something that you want to extend. In that case, you can use placeholder selectors. Now here's what they look like. They're like any other class definition, but they begin with a percentage sign instead. And then you add the name of the class that you would normally put there. When you want to extend the class, you simply use the extend at rule and then the name of the placeholder, like we do right here. What that will allow you to do is to create the button primary and the button secondary, but not have a BTN class by itself. So let's take a look at how that compiles. So here is the same sample that I've been using with button primary and button secondary. I don't have the one, that is just a BTN because that one is now not going to output 'cause I've used this placeholder selector right here. And if we take…

Contents