Forums

Use Dart sass

Hello, so I know one of the first replies to this question will be "duplicate of https://www.pythonanywhere.com/forums/topic/2704/", but it isn't, my problem isn't the same.

I've been using Bootstrap on my website for a while now, and my problem is that Bootstrap uses SASS stuff that the good ol' Ruby sass doesn't support (leading to the infamous bug where it prints the bugged sass on the page and doesn't compile, caused by stuff looking like -##-something in the sass we're trying to compile), so since that day I just compile the sass in local development and push everything, but it's not optimal at all, and I'd really wanna stop having to do this.

What I've tried:

Installing Dart Sass using npm install, it works, but then I can't tell sass to use this version, so it continues to use the Ruby version
Reinstalling my server, hoping that Ruby Sass wouldn't be installed by default, Idk if it's because I kept the same name, maybe it is
Changing the Sass version in path, didn't work at all
A few other stuff that I knew wouldn't work but still tried because why not
Installing LibSass but same problem as with Dart Sass, impossible to override the Ruby one.

What I'd like to know:

Is it possible to remove Ruby sass on Pythonanywhere
Or keep it but at least use the Dart Sass version

Thanks

well I meant to name it "Use Dart sass" but I failed... this day will be long

I've updated the thread title :-)

You can't remove the Ruby sass -- it's part of the operating system packages -- but you certainly should be able to override it with a different one.

What is the exact command that you're using to install the Dart sass, and once it's completed, what do you get it you run which sass? Do you know exactly where it has installed itself to?

I tried npm instrall dart-sass, doing which sass only shows the ruby one and I also tried installing it from github with https://github.com/sass/dart-sass/releases/tag/1.32.8 and it also did nothing, what would be the command to replace sass in the PATH ?

also thanks for renaming

Do you know where the npm command put sass? If it's in (say) /home/Khodok/something/somethingelse then you could prepend it to your PATH like this:

export PATH=/home/Khodok/something/somethingelse:$PATH

it worked ! my problem was that even if I installed any other sass version (and added it to the path) it would simply use the "sass" variable and take the Ruby one, so I tried doing this and now doing sass.js --watch works everywhere !!

Thanks a lot, my Python project that used to have 85% of CSS (according to Github) is once again closer to Python

Great, thanks for letting us know (and congrats on re-pythonizing your project :))