macmotp
2 years ago
954
3
General

Optional Sass Import

Posted 2 years ago by macmotp

I recently had to import optional files in SASS. Apparently there is no way to do it like so (that would be perfect):

@import optional_file !optional

or like in LESS

@import (optional) optional_file 

There is an issue on GitHub here -> https://github.com/sass/sass/issues/779 but it has not being solved, and maybe it will never be.

Do you know if there is a workaround, preferably not using js or webpack? Like "import if exists"?

Thank you

Please sign in or create an account to participate in this conversation.