Skip to content
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

do not output when referencing #2470

Merged
merged 9 commits into from
Mar 10, 2015
Merged

do not output when referencing #2470

merged 9 commits into from
Mar 10, 2015

Conversation

bassjobsen
Copy link
Contributor

should fix #2464

@lukeapage
Copy link
Member

Any chance of adding tests?

@lukeapage
Copy link
Member

and please can you merge latest so the builds pass?

@bassjobsen
Copy link
Contributor Author

oh i seems i commented on the wrong issues earlier today, sorry. For this issue (output when referencing) i tried to add a test. After all i focused in the wrong issue i think, cause @import (reference) "*.css" makes no sense in the first place.

Now this PR makes sure that @import "*.css" is not outputted when referenced.

When writing the test a found that only changing the Import.prototype.genCSS in less/tress/import.js caused an newline on the place of the @import in the output. For the latest reason i have add the same kind of logical in to-css-visitor.js too, as follows:

    visitImport: function (importNode, visitArgs) {
        if (importNode.path.currentFileInfo.reference !== undefined && importNode.css) {
            return;
        }
        return importNode;
    },

In fact only the changes in to-css-visitor.js are required, but for me it feels unnaturally do not the same in less/tress/import.js

@lukeapage lukeapage merged commit 6c66aeb into less:master Mar 10, 2015
@bassjobsen bassjobsen deleted the patch-12 branch March 10, 2015 10:21
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

Successfully merging this pull request may close these issues.

@import (reference) copies import directives
2 participants