Escape to Parent

Arguments

NameTypeDescription
$selectorstring (quoted)

Acceps a value as a class or id selector.

* Note that you have to use quoted string!

Examples

Call the mixin as many as the number of cases that you want the element response to and pass the related argument for each.

.parent-element{
  .element{
    @include escape-to-parent(".smartphone"){
      background-color: red;
    }
    @include escape-to-parent(".desktop"){
      background-color: green;
    }
  }
}
//CSS Output
.smartphone.parent-element .element {
  background-color: red;
}
.desktop.parent-element .element {
  background-color: green;
}