You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say I have two files, main.less and variables.less. As is, jekyll-less will happily compile both into main.css and variables.css. I don't need the latter file, but it's harmless.°
Now I change one of my variables in variables.less. variables.css gets recompiled. main.css, the file I actually care about, does not get updated, however, because jekyll-less doesn't understand that an @import statement means that changes to the imported files mean that this file needs to be recompiled as well. Every time you change an imported file rather than your main LESS file, you have to recompile by hand, which obviates the reason to use jekyll-less at all.
This isn't an obscure problem. It is a common pattern to spin out variables and mixins into helper files. Most notably, Twitter Bootstrap's source does this. But as it stands, you can't use Bootstrap's variables file to customize your Bootstrap colors without setting up a separate non-Jekyll-based watcher-compiler infrastructure.
I see a few ways to fix this.
One would be to write some code that could parse @import statements and recompile accordingly. That would be awesome, but probably difficult to do accurately and quickly.
Another, simpler way would be to pass config arguments to jekyll-less that would allow users to specify a file or files that should always be recompiled if any LESS file is changed. So main.less in the example above, or bootstrap/bootstrap.less in the Bootstrap case. That approach would indeed be dumb as a rock, but it would still be better than having to control-C + up arrow + Enter over and over and over again.
° If you have a more complicated inheritance structure with files included that rely on other previous includes, which is the case with Bootstrap 3 source, you will get a lot of errors logged to the console every time your LESS gets compiled. But it doesn't give up on compiling the files that matter, so the only problem is the noise.
The text was updated successfully, but these errors were encountered:
I created #11 for this. It allows to set an entrypoint file in the _config.yml. Even if another file is changed, less is only called on the entrypoint file.
Let's say I have two files,
main.less
andvariables.less
. As is, jekyll-less will happily compile both intomain.css
andvariables.css
. I don't need the latter file, but it's harmless.°Now I change one of my variables in
variables.less
.variables.css
gets recompiled.main.css
, the file I actually care about, does not get updated, however, because jekyll-less doesn't understand that an @import statement means that changes to the imported files mean that this file needs to be recompiled as well. Every time you change an imported file rather than your main LESS file, you have to recompile by hand, which obviates the reason to use jekyll-less at all.This isn't an obscure problem. It is a common pattern to spin out variables and mixins into helper files. Most notably, Twitter Bootstrap's source does this. But as it stands, you can't use Bootstrap's variables file to customize your Bootstrap colors without setting up a separate non-Jekyll-based watcher-compiler infrastructure.
I see a few ways to fix this.
One would be to write some code that could parse @import statements and recompile accordingly. That would be awesome, but probably difficult to do accurately and quickly.
Another, simpler way would be to pass config arguments to jekyll-less that would allow users to specify a file or files that should always be recompiled if any LESS file is changed. So
main.less
in the example above, orbootstrap/bootstrap.less
in the Bootstrap case. That approach would indeed be dumb as a rock, but it would still be better than having to control-C + up arrow + Enter over and over and over again.° If you have a more complicated inheritance structure with files included that rely on other previous includes, which is the case with Bootstrap 3 source, you will get a lot of errors logged to the console every time your LESS gets compiled. But it doesn't give up on compiling the files that matter, so the only problem is the noise.
The text was updated successfully, but these errors were encountered: