-
Notifications
You must be signed in to change notification settings - Fork 47
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
The --include-path option is missing #229
Comments
Hi, sorry for later answer, I'm glad you are interested in using less4j in your app. Import dir like functionality can be achieved using custom less source as described here. What is LessSource Three important methods:
Then you just have to use How to achieve what you want Using custom less source: //create demo less file and compiler
File inputLessFile = createFile("sampleInput.less", "* { margin: 1 1 1 1; }");
LessCompiler compiler = new ThreadUnsafeLessCompiler();
//use custom less source
CompilationResult compilationResult = compiler.compile(new CustomFileSource(inputLessFile));
//print compiled css
System.out.println(compilationResult.getCss()); Either constructor or
Note: import-once feature uses |
I updated wiki, because the same request was asked by multiple people. I added new |
Thanks for the nice answer. I'll check that. |
It would be nice if you could release your modifications, indeed. Thanks :) |
@gdelhumeau Done, less4j-1.8.3 should be available in maven central. |
Thanks @SomMeri ! |
You should just add the CustomFileSource to the code base as MultiFileSource or some such. I'm using less4j from a script environment and adding custom classes is a pain in the butt. |
I've made a pull request for this: #289 |
@gdelhumeau Thank you. |
Hello.
I would be very interested to use Less4j for the integration of LESS inside our application (XWiki: http://extensions.xwiki.org/xwiki/bin/view/Extension/LESS+Module).
But I cannot do it if there is no support for the "
--include-path
" option, which allows us to specify a directory where LESS can find the files that we would like to import using "@import
".Is there a plan to add this feature in Less4J?
Thanks,
Guillaume from XWiki.
The text was updated successfully, but these errors were encountered: