Talentedunicorn logo

The sass, the style & the ampersand

Last updated

While browsing through my news feed I recently came across an article by Rich Finelli on the Sass ampersand covering neat techniques to using the Sass ampersand. I would recommend reading if you use Sass in development.

Among the examples given these are my favorite:

Overriding styles

To override styles on a selector you can add a parent selector with a suffix &

Adding modifiers to selectors

To add a selector .class-modified you can nest the &-modifier inside .class