Reputation: 59
I hope you're gonna be able to help me. I am using VS Code and "Live Sass Compiler" by Ritwick Dey.
I was coding a grid and tried to add a background-image in scss to seperate items. Nothing fancy actually.
For example:
.item-2 {
grid-area: assessTheRightTime;
background-image: url(images/Weight\ loss.jpg);
}
When I saved after I uploaded all the images, I got an error notification. So in fact the code from scss did not transfer to css sheet - and to the browser.
When I went to generated style.css and put there directly the lines of code, it worked out automatically.
*UPDATE: It works for an image with a single name like: "weight". What if an image file's name is "Weight Loss" ? Does scss requires some specific syntax? I added %20 between "Weight and Loss" and it works. Is it obligatory or is there any way around? I mean what's going on with that :)
background-image: url(images/Weight%20loss.jpg);
So how to apply properly an image name with space character ? I am confused as scss bases on css syntax.
Am I missing something ? I spent a couple of hours trying to spot the problem. Thank you in advance :)
2nd question: Is it normal that VS Code shows tons of Errors & Warnings on CSS sheet, being aware that it's compiled from scss ? I know that CSS doesn't accept some syntax (for example square bracket) that scss generates but what's the truth?
Thank you, Maciej
Upvotes: 0
Views: 242
Reputation: 180
Upvotes: 0