Ampersand conflict in LESS and SASS compilers -


i'm converting less sass , i'm getting error due block of code

.navbar{     &-inverse {         .brand:hover {             color: black;         }     } }  

this piece of less causing me sass error:

invalid css after " &": expected "{", "-inverse {" "-inverse" may used @ beginning of compound selector. 

in both languages,& placeholder parent of current level of nesting (so in case .navbar), problem , how can solve it?

in sass & works child/parent/adjacent selector (space, >, +, ~, ... ignored, if in front, or adds parent after selector) or add class (starting .), id (starting #) or pseudo-selector (starting :).

the functionality want not implemented yet, planned v3.3. can read bit more here.

you example design mixin appends selector. maybe in direction:

@mixin inverse($selector){     #{$selector}-inverse {         .brand:hover {             color: black;         }     } }  @include inverse(".navbar"); 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -