Topic: Can we get path variable in Sass
admin5 pro asked 7 years ago
src: local(Roboto Thin), url('#{$roboto-font-path}Roboto-Thin.eot');
), this means I could just predefine it like so:
$roboto-font-path: "../node_modules/mdbootstrap/font/roboto/";
@import '../node_modules/mdbootstrap/sass/mdb.scss';
However the problem is the img path does not work the same, it does not make use of a variable in the path (In _hover-effects.scss: background: url(../img/overlays/01.png);
) , this means it can't be imported to another folder.
So can I ask that you also change that in to using a variable, just like you did with fonts. For example you can change it into:
background: url(#{$img-path}overlays/01.png);
and then add $img-path: "../img/" !default;
in _variables.scss, just like you did with fonts here as well: $roboto-font-path: "../font/roboto/" !default;
Doug Kent free answered 7 years ago
admin5 pro commented 7 years ago
Hi Doug, Don't get your hope up. I have been asking for 10 months. MDB has absolutely no clue as to how big of an issue this is. And yet it is so easy to fix. I bought the PRO version of MDB beginning of the year to accelerate our companies front end development, and to be honest, I don't know if it was worth it See my other posts about it: https://mdbootstrap.com/support/can-we-get-path-variable-in-sass-asking-again/ https://mdbootstrap.com/support/path-variable-for-images-not-fully-functional/Doug Kent free commented 7 years ago
Ah, indeed you have been persistent, Marta! Thanks for that! Maybe we'll get lucky and they'll take the pull request. It is the same change you described in one of your posts. What I don't understand is how so few people apparently must be trying to use MDB SASS. Maybe people aren't using carousel, the removal of which works around this problem. Maybe people are following MDB's suggestion, which I believe is really unreasonable, to put their custom SASS files _inside_ the package (like the node_modules) folder.John Livingston pro answered 7 years ago
John Livingston pro answered 7 years ago
Marta Wierzbicka staff answered 7 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: Yes
- Provided link: No