-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Feature request] - Import directory #580
Comments
How do you imaginate this? This is impossible. LESS is a cliend-side javascript solution. What you are looking should be a server-side solution. |
LESS is both client and server, depending on preference.. I could look into this if I have time. |
Ordering not important? |
Ordering could be an issue but in my use case I've got a 'modules' directory which has styles for different modular components (each module has a .less file) where it doesn't matter what order they get included in. |
@whitman, did you ever find the solution? |
@roblafeve I didn't. In the end it wasn't really an issue to just add the individual files. It could still be a useful thing though. |
I think this would break client-side functionality. The web page doesn't know what files exist on the server, hence it can't import a directory without a server-side script. Because of that, and since another solution was found, I recommend closing this issue. |
Seconded. |
I still think this would be a great feature server-side. "This is hard" is hardly an excuse to close it. |
reopened There is another issue thats similiar knocking around too. |
@lukeapage Duplicate of #1181 and #1413 (or those are duplicates of this). |
Also, yes, with a proper return value of either the directory list or "not supported", this would probably be okay at that point. |
This would be extremely useful. It would also be a nice advantage over using SASS, which also doesn't have this feature. |
I've got to +1 this :) I can live without it but it would be a great improvement to me to have this feature. Well, that was my 2 cents ! |
I now think this is something best implemented with a plugin. I'd rather see the API evolve so that the various approaches to file loading are kept out of Less.js core, which (IMHO) should really be focused on parsing. if we were to add this to less.js core though, I think #1181 would be much more advantageous, since globbing patterns allow you to load directories of files, specific files, exclude files or extensions, and so on. |
@jonschlinkert I'm starting to lean that way too, especially as the API / plugin stuff is gaining momentum. I'm even thinking we should consider moving anything from core to plugins that isn't cross-platform (Node/Rhino/Browser), such as data-uri. Which of course, means this issue is still valid, it just may be addressed in a different way, yes? |
Lol, I was thinking the opposite. If you think about it (if @lukeapage, @seven-phases-max et al had unlimited time, desire, and incentive to do so) ideally the core would be focused on code that is platform agnostic, leaving platform implementations to other "contrib" projects, e.g I'm personally in favor of this route. I can envision a time when the issues on Less.js are almost entirely related to language features, parsing, and related performance and reliability. While other libs would be created to deal with file loading, environment differences, CLI, etc. |
wait, I just re-read lol. you said the same thing. I read it backwards the first time... I read "isn't cross-platform" as "is cross-platform". anyway, good stuff! |
^_^ I think we're all on the same page. |
Technically its easier to change less so that it asks its environment for a Because of the way imports work this particular feature will be harder to |
Bump! |
merging with #1181 |
I've got a number of modules I'm writing styles for, one file per module, and currently I'm importing each
.less
file. Instead it would be useful to just able to@import 'directory_of_files/'
which would include all of the less/css files in the directory.The text was updated successfully, but these errors were encountered: