What Are People Using To Convert Sass Files to CSS?
How to convert directory SASS/SCSS to CSS via command line? - Stack Overflow
Useful: Convert CSS to SCSS/SASS
Clean up multiple CSS files and convert them to SCSS
Videos
Hi
I was using deanwiseman/DartSassBuilder: Sass builder (dart compiler) for .NET projects (github.com)
but I am dockerizing my project and it won't work as my docker only targets .net 8 and apparently this needs .net 8.
I guess I could install .net 6 in my docker but seems kind of over kill just for this one .dll to work.
add support for dotnet 7 ยท Issue #24 ยท deanwiseman/DartSassBuilder (github.com)
Dot net upgrade by carlosmachina ยท Pull Request #34 ยท deanwiseman/DartSassBuilder (github.com)
Seems like it was requested and even a fix but no one is merging the fix in so looks like this project is dead.
To do a one-time Sass compile instead of a watch, you can do this from the command line:
sass --update scss:css
To have Sass import one file (usually a partial, with a _ starting the filename), you can do this inside a Sass file:
@import "_base.scss";
This way, Sass knows where you want the include to occur.
By default, Sass can't import an entire directory. The Sass Globbing gem, however, can. You can install it from the command line:
gem install sass-globbing
And then watch with it:
sass -r sass-globbing --watch sass_dir:css_dir
Note that globbing will import files alphabetically, so be sure your CSS will cascade appropriately if this occurs.
Use the sass command followed by the input file name and path, a colon (:) and the desired output file name and path. If the output file does not already exist Sass will generate it. For example,
sass sass/main.scss:css/main.css
However, this is a one-off command that would require being run every time you want to generate a new CSS file. A simpler and handier method is to use Sass's built-in --watch flag. This watches for changes to your Sass file and automatically runs the compile command each time you save changes.
sass --watch sass/main.scss:css/main.css
If you have multiple Sass files within a directory you can watch for changes to any file within that directory:
sass --watch sass:css
Sass also has four CSS output styles available: nested, expanded, compact and compressed. These can be used thus:
sass --watch sass:css --style compressed
Refer to the Sass documentation for more.
ยป npm install @dhunanyan/scss-to-css-converter