Handle path to assets

The CSS generated by Galaxy won't be inside the folder "public," so you can not do relative path, you need to use an absolute path to get the asset.

/* This won't work !*/
.selector {
    /* ... */
    background-image: url('../img/pattern.svg');
}

Inside your main.scss file, define $assetsPath variable, that will contain the path to the public folder.

main.scss
$assetsPath: '/integration/THEME_NAME/public'; /* TODO: replace THEME_NAME */

/* Here is how to use it later */
/* 
.selector {
    // ...
    background-image: url($assetsPath + '/img/pattern.svg');
}
 
*/

Last updated