Answer the question
In order to leave comments, you need to log in
How to make an image path mixin?
I'm trying to master SCSS
I want to make a mixin so that each time I don't write the path to the pictures, but automatically when assembling it, I would
try to do it
@mixin img_bg($src) {
background-image: url(../img/[email protected]);
}
@include img_bg("cherv_bg.jpg");
Answer the question
In order to leave comments, you need to log in
@mixin img_bg($src) {
background-image: url(../img/#{$src});
}
@include img_bg("cherv_bg.jpg");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question