简体   繁体   中英

SCSS Ampersand Usage Error

I haven't been working with SCSS for very long, so I do not understand why I am getting an error with the example below. It works fine in Codepen, but when I put it in my meteor project, i get an error.

.hover {
  &:extend(.post-module:hover all)
  .post-content {
    .description {
      display: block !important;
      height: auto !important;
      opacity: 1 !important;
    }
  }
}

The error I receive when using a SCSS Validator is below:

Parsing Errors .hover:extend(.post-module:hover all) .post-content .description { Expected RPAREN at line 1, col 15.

How am I missing a right parenthesis? I just don't understand.

You are just missing a semicolon after &:extend(.post-module:hover all) :

.hover {
    &:extend(.post-module:hover all);
    .post-content {
        .description {
            display: block !important;
            height: auto !important;
            opacity: 1 !important;
        }
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM