Skip to content
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

Sass loop function for import files #2531

Closed
nikhil-toobler opened this issue Jun 29, 2018 · 1 comment
Closed

Sass loop function for import files #2531

nikhil-toobler opened this issue Jun 29, 2018 · 1 comment

Comments

@nikhil-toobler
Copy link

Any option to import multiple files using sass loop function. Here below my file tree structure.

/scss/ 
    /pages/
        /home/
            home.scss
            home-sm.scss
            home-md.scss
            home-lg.scss
        /about/
            about.scss
            about-sm.scss
            about-md.scss
            about-lg.scss
        /contact/
            contact.scss
            contact-sm.scss
            contact-md.scss
            contact-lg.scss
        pages.scss

And importing structure in pages.scss like below

//home
@import "home/home";
@import "home/home-xs";
@import "home/home-sm";
@import "home/home-md";
@import "home/home-lg";

//about
@import "about/about";
@import "about/about-xs";
@import "about/about-sm";
@import "about/about-md";
@import "about/about-lg";

//contact
@import "contact/contact";
@import "contact/contact-xs";
@import "contact/contact-sm";
@import "contact/contact-md";
@import "contact/contact-lg";

I want to reduce this import steps like using with sass function or anything.

Note: I think using @import "scss/**/*" method is not a good deal for some cases like prioritized ordering files, overriding, etc.

@nex3
Copy link
Contributor

nex3 commented Jun 29, 2018

Duplicate of #739

@nex3 nex3 marked this as a duplicate of #739 Jun 29, 2018
@nex3 nex3 closed this as completed Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants