Skip to content

Better explain import by reference with html tag based rules. #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AoDev opened this issue Jul 6, 2014 · 3 comments
Closed

Better explain import by reference with html tag based rules. #205

AoDev opened this issue Jul 6, 2014 · 3 comments

Comments

@AoDev
Copy link

AoDev commented Jul 6, 2014

Hello,

A simple observation. When I use:

@import (reference) "docs.less";

if docs.less contains tag rules like this:

div {
    background-color: #000;
}

.black {
    background-color: #000;
}

The first rule will be outputted. No problem here. But it's not mentioned in the docs.

I actually use this feature in a real use case. For example, I import twitter bootstrap as a "mixin" library. I import the forms related less file by reference and then pick only what I need. (but it still outputs their form related tag rules, which is needed)

I want to make sure that it's an expected behaviour, clarify the docs and that it won't change in the future. (well it would break my stuff ;)

@seven-phases-max
Copy link
Member

No, actually div does not output too in your example. Certain Bootstrap classes appear in the output of a (reference) imports because of using extend (see less/less.js#1851 (comment)).

@AoDev
Copy link
Author

AoDev commented Jul 6, 2014

Ok sorry, i simplified my code without taking into account something. I am scoping the import.
But I don't use extend anywhere and still, everything is included.

@seven-phases-max
Copy link
Member

I am scoping the import.

And this is a different issue I answered too (less/less.js#2097). OK, so if you dont mind I'm closing this (it's the wrong repo anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants