-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Labels
Description
Hey, I am facing a really weird problem. Lessc is somehow not working :not selector. Here is my selector:
.main-navigation {
background-color: #069;
overflow: hidden;
}
.nav-bar {
display: flex;
justify-content: space-between;
margin: 0;
padding: 0;
}
.nav-bar > li {
align-self: center;
list-style-type: none;
&.main-logo {
flex: 0 0 auto;
width: 100%;
@media screen and (min-width: 700px) {
width: 50%;
}
@media screen and (min-width:900px) {
width: 70%;
}
}
}
.nav-bar > li a {
display: block;
color: white;
text-decoration: none;
border-bottom: 3px solid #069;
}
.nav-bar > li a:not(.logo) {
text-align: center;
padding: 14px 18px;
}
@media all and (max-width: 700px){
.nav-bar{
flex-wrap: wrap;
justify-content: flex-start;
}
}
.nav-bar li a:hover:not(.logo):not(.active) {
border-bottom: 3px solid #E7403C;
color: #E7403C;
}
.active {
border-bottom: 3px solid #E7403C;
}
When i run:
lessc style.less style.css
it results in:
.nav-bar {
margin: 0;
padding: 0;
overflow: hidden;
background-color: #069;
}
.nav-bar li {
float: left;
padding-top: 20px;
right: 0;
left: auto;
list-style-type: none;
}
.nav-bar li a {
display: block;
color: white;
text-align: center;
padding: 14px 18px;
text-decoration: none;
border-bottom: 3px solid #069;
}
.nav-bar li a:hover:not(.active) {
border-bottom: 3px solid #E7403C;
color: #E7403C;
}
in terminal.
There are several things wrong in the css:
- .main-navigation is missing
- Style.css is empty.
- :not selector not working as expected.
Steps taken to install Less:
- Go to website (http://lesscss.org/#)
- Install with:
npm install -g less
Other observations:
When file is empty, it works fine i.e. it does not compile any CSS. But as soon as I add above CSS, it repeats same thing. If I compile it at, http://lesscss.org/less-preview/ it returns correct result.