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

Less: "@import (less) "file.css"" breaks variable recognition #164

Closed
heldchen opened this issue Aug 14, 2013 · 2 comments
Closed

Less: "@import (less) "file.css"" breaks variable recognition #164

heldchen opened this issue Aug 14, 2013 · 2 comments
Milestone

Comments

@heldchen
Copy link

since less 1.4.0 (https://github.com/less/less.js/blob/master/CHANGELOG.md#140-beta-1--2) it is now possible to specify how a file included with @import should be handled:

You can specify options on imports to force it to behave as css or less @import (less) "file.css" will process the file as less"

the following code unfortunately breaks:

@import (less) "base.css";

@size: 13px;

.control
{
    font-size: @size;
}

albeit the variable is declared locally, the syntax highlighter marks the line font-size: @size with the error The variable '@size' is undefined in this context. commenting out the import statement makes the error go away.

@vtst
Copy link
Owner

vtst commented Aug 16, 2013

Thanks for the bug report. The problem came from the fact that .css files are not loaded by the plugin as LESS stylesheet. The code was throwing an IllegalStateException when attempting to access the contents of the CSS file.
If fixed the code to catch the exception. Please note however that the contents of the css file will *not
be analyzed by the plugin, though it is imported as a LESS stylesheet.

@vtst vtst closed this as completed Aug 16, 2013
vtst added a commit that referenced this issue Aug 16, 2013
@heldchen
Copy link
Author

perfect, thanks!

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