This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I'm sure this is a very basic question, but I have currently run into the problem where I have mulitple less files for different areas of an application. For example, I have a dashboard less file, a general layout less file, etc. My main less file has all of my base/preset style less imports (i.e., @imports "base.less", @imports "globals.less", etc.) and now I am importing the dasboard less styles. Unfortunately, I need those base/preset styles available to the dashboard less file as well, but do not want the compiled css file to directly embed those styles again. Is there a way to do this (i.e., reference the mixins, but not actually import them so that the resulting css file shows them multiple times in the compiled css)? Thanks for any help that can be provided! Adam |
|
|
This is just how Less behaves currently (if you have CSS in the imported file then that will be included, and if you have a nested scenario then you can end up with that CSS being imported multiple times). That said it sounds like this will be sorted out in a future release - see https://github.com/cloudhead/less.js/issues/212 for some discussion about this. Do you actually need to include the CSS in your base/preset file? or can this be included at the next level up? :)
|
|
|
Turns out that even though the Web Workbench compiler (on save of the less file) throws the error, if I actually go look at the newly compiled css files, they do indeed add the mixin styles like expected. So I guess this might be a bug (using Visual Studio 2012). And yes, I reference those base styles throughout many stylesheets (as that's the whole idea behind them being base styles), so I need to reference them (well, to save me time from retyping those styles... which is what is nice about Less). Other than the error being thrown (mixin does not exist), it does seem to actually do what is expected, so I can keep using as is (just threw me for a loop as it was crying that it couldn't find it, even though it actually did). Thanks for taking the time to respond. |
|