Login with:


Not a member? Sign Up

Forgot Password?

Signup with:


Already have an account? Log in

Can we get path variable in Sass

Home Forums Material Design for Bootstrap Support Can we get path variable in Sass

This topic contains 1 reply, has 2 voices, and was last updated by  Marta Szymanska 1 month, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
Version: MDB 4.2.0
  • Author
  • #13270


    Long story short I created a private npm repo for the theme, thus the theme will be located in node_modules in my project. For this reason when I import the mdb.scss file I get 2 errors (both related to relative paths not being found since my style.scss is not located in the node_modules folder):

    1. Cannot find module “../font/..”
    2. Cannot find module “../img/..”

    I was able to fix the font issue because it uses the variable $roboto-font-path in its path (In _roboto.scss: 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;

    • This topic was modified 1 month, 2 weeks ago by  admin5.

    Marta Szymanska


    Thank you for notice and we look at this issue soon.


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.