Concatenating nested classes using SASS [duplicate]

&

You can achieve this with the ampersand operator. Try:

.a .c
  display: inline-block

  &.date
    width: 50px

The ampersand is a placeholder for parent selectors. And if you don’t place a space after it in a nested selector it will output a concatenated selector (just what you want).

DEMO


Note: in deeper nested selectors & stands for the whole path of nested selectors not just for the immediate parent.

Leave a Comment