I’m learning Sass on Windows with a local site on my PC. I’m trying to convert my WordPress theme’s CSS. I created a folder under my theme called “sass”. In it, I have my partials like _reset.css
My Windows command prompt reads:
C:\Users\Anne\Documents\Websites\www.test.dev\wp-content\themes\enterprise-pro>
I’ve entered the following watch command
sass --watch style.scss:style.css
Before trying to add the partials, the watch and compile produced the correct changes in my style.css.
However, if I add these @import lines after the WordPress theme info block to my style.scss file I see:
@import "/sass/reset.css";
// Variables and Placeholders
$safari-color1: #f2b538;
$safari-color2: #A69D57;
$safari-color3: #322215;
$basefont: 'ITC Berkeley Old Style W01', sans-serif;
$background: #fef8ec;
@import "/sass/setup.css";
/* Defaults */
My output in style.css comes out as:
@import url(/sass/reset.css);
@import url(/sass/setup.css);
/* Defaults */
The contents for each of the import files shows as @import URL and the section where I defined my variables and placeholders is missing.
I did install Ruby with the path option. In Windows, I can see a path variable:
C:\Ruby22-x64\bin;C:\Users\Anne\AppData\Roaming\npm
Initially, when I did the @import, I didn’t use a file extension. However, it seems the only way I get Sass to compile is to use the .css extension. If I leave blank or use .scss, I get an error saying file can’t be found or is unreadable.
I tried removing the variable section but that didn’t help either.
I’ve also tried putting all the files in the same folder. In fact, I could put in a bogus file name and so long as I have it as a .css file, I don’t get any errors. But, I’ll see that bogus file in my style.css file.
And when I do save my style.scss file, I can see that changes were detected and I have:
write style.css
write style.css.map
What am I missing?