leafo / lessphp

LESS compiler written in PHP
http://leafo.net/lessphp
Other
2.2k stars 529 forks source link

Imported files get optimized incorrectly. #655

Closed jdlrobson closed 3 years ago

jdlrobson commented 3 years ago

Create the following 2 files

1) test.less:

@media screen {
    body:not( .skin--responsive ) {
        @import 'test-import.less';
    }

    body.skin--responsive {
        @media ( min-width: 551px ) {
            @import 'test-import.less';
        }
    }
}

2) test-import.less:

a {
    color: red;
}

Expected:

The LESS compiler should produce:

@media screen {
  body:not( .skin--responsive ) a {
    color: red;
  }
}
@media screen and (min-width: 551px) {
  body.skin--responsive a {
    color: red;
  }
}

Actual:

@media screen {
  body:not( .skin--responsive ) a {
    color: red;
  }
}
jdlrobson commented 3 years ago

my bad, seems I've raised this against the wrong product! Sorry for the noise.