-
Notifications
You must be signed in to change notification settings - Fork 1
Extend documentation #2
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
Comments
I think the readme already describes pretty detailed what this plugin does and how it can be used. Do you have any further questions? |
Thanks for answering so quickly, may be it is my problem, but I still can't understand, how plugin do what you describe in documentation. I know that lesscss-resources plugin provide compiling of .less to .css, also it supports @import directive, so I can use my own file with variables like @main-color e.g., but I can't understand, how does plugin work. Less file should be compiled to css, does plugin add my _mixin.less to begining of the result.less and invoke recompile? Why should I restart server after adding _mixin.less? Thanks. |
This plugin works before the compiling of the less files happens, it copies all the content of external resources either to the beginning (prepend) or end (append) of a configured file. The plugin supports live reloading as well, restarting is only necessary in production mode and, at the moment also for less files because of an issue with the lesscss-resources plugin (paulfairless/grails-lesscss-resources#49). Let me try to explain the plugins features again: Imagine you have a project where you have several less files. in all your other files you include these two files. My plugin would allow you to get rid of the @import statements for all files by specifying grails.resources.mappers.augment.lesscsscompatibility = true
grails.resources.mappers.augment.augment = [
'less/*.less' : [
prepend: ['less/imports/_variables.less', 'less/imports/_mixins.less']
]
] But as mentioned several times already, this is only a possibility and nothing you would do in a real project. What is much more likely is that you use the append feature to modify some of your variables you defined in your _variables.less file. Imagine you have deployed your application on a tomcat for a customer. The customer isn't satisfied with the colors used by your application because they don't match the colors of his coporate identity. In your config just specify grails.resources.mappers.augment.lesscsscompatibility = true
grails.resources.mappers.augment.augment = [
'less/*.less' : [
append: "file:${System.properties['catalina.base']}/ci/ci_colors.less"
]
] This way your application will maintain it's default styling unless you provide the configured ci_colors.less file within the tomcat directory of your deployed application. |
Ok, now pretty clear. Thanks for explaining in detail. |
Your welcome, glad i could help |
Hi. Can you please explain more clear what this plugin do? Plugin added variables before compiling .less files e.g.? What is the difference between @import with another less file? Thanks.
The text was updated successfully, but these errors were encountered: