Posted over 2 years ago. Visible to the public. Repeats.

Sass: Do not use comments between selector definitions

Sass lets you easily specify multiple selectors at once like this:

Copy
.some-block &.has-hover, &:hover outline: 1px solid red

This will add a red outline on either real hover or when the has-hover class is present. However, adding a comment will void the definition of that line:

Copy
.some-block &.has-hover, // From hoverable.js <-- DON'T &:hover outline: 1px solid red

… will simply drop the &.has-hover part.

Growing Rails Applications in Practice
Check out our new e-book:
Learn to structure large Ruby on Rails codebases with the tools you already know and love.

Owner of this card:

Avatar
Dominik Schöler
Last edit:
over 2 years ago
by Arne Hartherz
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Dominik Schöler to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more