CSS Sass Basics Improve Your Workflow with Sass Write Nested Selectors

Tadjiev Codes
Tadjiev Codes
9,615 Points

Next, use the & symbol to create the selector .icn-success. Set the color of .icn-success to green.

I'm really confused about this nesting selectors questions???

style.scss
.banner {
  padding: 1em;
  background-color: lightgrey;

.button {
   font-size: 1.5em;
 }
}
 .icn {
    font-size: 1.25em;
&-.icn-success. {
color:green; 
}

}
&-.icn-success. {
color:green; 
}

1 Answer

icn is already included with the &

.banner {
  padding: 1em;
  background-color: lightgrey;

.button {
   font-size: 1.5em;
   }
}
 .icn {
    font-size: 1.25em;
  &-success {
    color:green; 
   }
}