Menelaos Bakopoulos Menelaos Bakopoulos -4 years ago 200
Sass (Sass) Question

scss error - &:not(": expected ")", was "'.full')

I'm a bit confused with the following errors. I have no experience with SCSS.. it's a file a subcontracting front-end designer company gave us.
I am attempting to compile using KOALA that seemed to be an easy open source free windows sass compiler.

Errors:

assets\sass\main.scss
Error: Invalid CSS after "&:not(": expected ")", was "'.full')"
on line 23 of assets/sass/components/_last-update.scss
from line 13 of assets/sass/_components.scss
from line 8 of assets\sass\main.scss
Use --trace for backtrace.


The specific code causing the error seems to be:

@media (min-width: $bp-medium) {
&:not('.full') { max-width: 60%; }
margin-bottom: $vertical-spacing-medium;
}


Specifically:


&:not('.full') { max-width: 60%; }


I tried removing that part all together and it seems to work but I havn't understood yet the SCSS/SASS syntax and why it would not be working. I've only been explosed to this language for 30' now.

Answer Source

I think the problem are the hypens in the selector. e.g.

&:not('.full') { max-width: 60%; }

should become

&:not(.full) { max-width: 60%; }

as defined by the specification: https://developer.mozilla.org/de/docs/Web/CSS/:not

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download