kriswallsmith / assetic

Asset Management for PHP
MIT License
3.75k stars 555 forks source link

Variables/mixins not usable in subsequent less files when loading multiple resources #353

Open SimonHarte opened 11 years ago

SimonHarte commented 11 years ago

{% stylesheets '../src/Terrific/Composition/Resources/public/css/project.less' '../src/Terrific/Module//Resources/public/css/.' '../src/Terrific/Module//Resources/public/css/skin/.' filter="less" output="css/compiled/base.css" %}

.linear-gradient() defined in project.less, used in module grid.less

[exception] 500 | Internal Server Error | RuntimeException [message] NameError: .linear-gradient is undefined in grid.less:14:2

stof commented 11 years ago

This is because less file are compiled separately, not together. To access mixins from other less files, you need to use the import feature of Less

SimonHarte commented 11 years ago

Thanks for the response stof, I know that, but it would be awkward to maintain if we had to @import all our module styles in project.less, especially because they aren't fix, they get added and removed during development...

I'm not totally sure if this is a "problem" with assetic, but in case of less, the files should be merged together and then passed to the compiler.

stof commented 11 years ago

@BuschFunker the issue is that if you merge the files together and then pass them to less, it will break the import statements in them when the files you are merging together are not in the same folder

SimonHarte commented 11 years ago

@stof Since the idea behind giving multiple resources is not having to @import files in other folders, this wouldn't be a problem. The only @imports we have here for example are in project.less, which just bundles general files like yui reset, grid and elements stylesheets in the same folder.