less/less-docs

Auto importing directories' index file

Buzut opened this issue · 1 comments

Buzut commented

In a similar fashion to many web standards, could we have the ability to reference a directory and have its index.less imported if it has one?

That would allow for a very streamlined workflow. Exemple:

header/
    index.less
    logo.less // logo with loads of style because it's animated
    navigation.less
    mobile-navigation.less

Now with this file hierarchy, one could @import header from the main stylesheet and be done with it. All other imports are to be managed by index.less. Loads of PHP and Node.js projetcs are structured this way, it would allow for a similar logic in terms of styling.

Currently, one would have to have a header.less outside of the header/ directory required as an intermediary file but it adds visual clutter to the main style directory.

Alternatively, one could use index.less in a header/ directory, but has then to import it explicitely with an ugly @import header/index.

Buzut commented

Migrated to less.js repo.