User Tools

Site Tools


sasset:referencing_parent_selectors_with

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

sasset:referencing_parent_selectors_with [2016/04/02 11:52] (current)
leo created
Line 1: Line 1:
 +|<- [[Using the @extend method]]|[[Using comments and hidden comments]] ->|
  
 +& est un sélecteur spécial désignant le parent de l'​élément
 +
 +<​code>​
 +.item {
 +  background: white;
 +  &:hover {
 +    background: red;
 +  }
 +}
 +</​code>​
 +
 +<​code>​
 +@mixin clearfix {
 +  &:​before,​
 +  &:after {
 +    content:'';​
 +    display: table;
 +  }
 +  &:after {
 +    clear:both;
 +  }
 +}
 +
 +.item {
 +  @include clearfix;
 +}
 +</​code>​
 +
 +Contextual class
 +
 +<​code>​
 +.item {
 +  #abc & { // #abc .item {}
 +    color: red;
 +  }
 +}
 +</​code>​
sasset/referencing_parent_selectors_with.txt · Last modified: 2016/04/02 11:52 by leo