less / less.js

Less. The dynamic stylesheet language.
http://lesscss.org
Apache License 2.0
17k stars 3.41k forks source link

Missing whitespace in import causes translation to stop #3690

Closed zhusjfaker closed 2 years ago

zhusjfaker commented 2 years ago

To reproduce:

a.less

.a {
  font-size: 16px;

  .b {
      margin: 0;
      color: #000;
  }
}

index.less

@import"./a";

.a {
    font-size: 16px;

    .b {
        margin: 0;
        color: #000;
    }
}

Current behavior:

gen css ->

@import "./a";
.a {
  font-size: 16px;
}
.a .b {
  margin: 0;
  color: #000;
}

Expected behavior:

.a {
  font-size: 16px;
}
.a .b {
  margin: 0;
  color: #000;
}
.a {
  font-size: 16px;
}
.a .b {
  margin: 0;
  color: #000;
}

Environment information:

iChenLei commented 2 years ago
- @import"./a";
+ @import "./a";

Are you missing the blankspace between @import and "./a" ?

zhusjfaker commented 2 years ago
- @import"./a";
+ @import "./a";

Are you missing the blankspace between @import and "./a" ?

I personally don't think space it's necessary at the grammatical level