&
&
means the parent selector1// Example SUIT-css style component
2.MyComponent {
3 &.is-animating {}
4 &--modifier {}
5 &-part {}
6 &-anotherPart {}
7}
1// Example link states
2a {
3 color: gray;
4
5 &:hover,
6 &:active {
7 color: black;
8 }
9}
1// Example 'reverse' parent selector
2.btn {
3 background: #666;
4 color: #fff;
5
6 .theme-dark & {
7 background: #333;
8 }
9
10 .theme-light & {
11 background: #ccc;
12 color: #333;
13 }
14}
1// Sibling selectors
2
3.button {
4 & + & {
5 // styles for .button + .button
6 margin-left: 1em;
7 }
8}
ul
that contains buttons. You often end up removing padding for left for the first item li:first-child
and padding from the right for the last item li:last-child
. With sibling selectors, you can only add padding to one side between adjacent elements1.block {}
2.block__element {}
3.block--modifier {}
1// function( $color, $amount )
2lighten($color, 10%)
3darken($color, 10%)
4saturate($color, 10%)
5desaturate($color, 10%)
6invert($color)
7grayscale($color)
8complement($color) // opposite color on color wheel
9transparentize($color, 0.5)
10opacify($color, 0.5) // amount is in decimal numbers
Gradients, borders and drop shadows are good use cases
You can perform multiple color functions by putting them inside of one another
1lighten( saturate(), 10% )
2transparentize( desaturate(), 20% )
//
and /* */
//
Comments are SCSS only, won’t compile into CSS/* */
are regular old CSS comments that will compile into source//
for all comments that are supposed to be for my eyes only1
2// This is a Sass only comment
3
4/*
5This is a (public) CSS comment
6*/