SASS syntax does not generate &: hover in css

I searched around. I found some similar questions about stackoverwflow and other resources, but most of them related to syntax errors.

Can someone tell me what is wrong with this code and why SASS does not generate: hover as a result of css?

Here is my SASS code:

.img-ornament
    -webkit-transition: all 0.5s ease
    -moz-transition: all 0.5s ease
    -ms-transition: all 0.5s ease
    -o-transition: all 0.5s ease
    transition: all 0.5s ease
    &:hover
        -webkit-transform:scale(0.75)
        -moz-transform:scale(0.75)
        -ms-transform:scale(0.75)
        -o-transform:scale(0.75)
        transform:scale(0.75)

Here is the css result:

.img-ornament {
    -webkit-transition: all 0.5s ease;
    -moz-transition: all 0.5s ease;
    -ms-transition: all 0.5s ease;
    -o-transition: all 0.5s ease;
    transition: all 0.5s ease;
}

Where: part of the hover?

here sassmeister gist https://gist.github.com/sayfulloev/396477b5a91f9511c8eb

+4
source share
1 answer

SASS syntax (indented) is very space-sensitive. If you convert your code to SCSS syntax, you will get a clearer idea of ​​how it is interpreted:

.img-ornament {
  -webkit-transition: all 0.5s ease;
  -moz-transition: all 0.5s ease;
  -ms-transition: all 0.5s ease;
  -o-transition: all 0.5s ease;
  transition: all 0.5s ease;
  &:hover {
    -webkit-transform:scale(0.75) {}
    -moz-transform:scale(0.75) {}
    -ms-transform:scale(0.75) {}
    -o-transform:scale(0.75) {}
    transform:scale(0.75) {}
  }
}

, SASS transform:scale(0.75) , /. , Sass .

, Ruby Sass, LibSass, , .

TL;DR;

.

.img-ornament
  -webkit-transition: all 0.5s ease
  -moz-transition: all 0.5s ease
  -ms-transition: all 0.5s ease
  -o-transition: all 0.5s ease
  transition: all 0.5s ease
  &:hover
    -webkit-transform: scale(0.75)
    -moz-transform: scale(0.75)
    -ms-transform: scale(0.75)
    -o-transform: scale(0.75)
    transform: scale(0.75)
+5

Source: https://habr.com/ru/post/1609809/


All Articles