Skip to content

Lessc command line issues #3216

@alokpant

Description

@alokpant

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:

  1. .main-navigation is missing
  2. Style.css is empty.
  3. :not selector not working as expected.

Steps taken to install Less:

  1. Go to website (http://lesscss.org/#)
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions