2

The Situation

I'm working on a website on a remote server using FTP in Visual Studio 2015 (with Web Compiler and Web Essentials), and I cannot figure out how to import _bootstrap.scss to my own .scss file.

My files on the remote server are set up like this:

-bootstrap-sass
 +fonts
 +images
 +javascripts
 -stylesheets
   +bootstrap
     _bootstrap.scss
     main.scss

All the correct files in the bootstrap folder are there, including _variables.scss.

When I am editing main.scss and I hit CTRL-S to save, WebCompiler has it automatically compile into main.css and uploads that file to the server. I know that is working.

The Problem

When I include the line @import "bootstrap"; in main.scss, it fails to compile and gives me the error:

(WebCompiler) Error: file to import not found or unreadable: bootstrap\variables

So it's basically failing on the part of _bootstrap.scss that says: @import "bootstrap/variables";. I can't figure out how to get this import to work correctly, and every resource I've found so far is reliant on Ruby, Compass, or Bower. I'm not using any of those (other than having used Ruby to install SASS on my machine, but I think WebCompiler in VS2015 is taking care of that anyway), I'm just using SASS and trying to compile it.

Colin Bacon
  • 15,436
  • 7
  • 52
  • 72
Samuel Reid
  • 1,756
  • 12
  • 22
  • Just to be clear, is your file hierarchy correct? `_bootstrap.scss` and the `bootstrap` folder should be on the same level and then `_variables.scss` should be a child of the `bootstrap` folder – Colin Bacon Jul 30 '15 at 11:16
  • Yes, that is correct. The `bootstrap` folder is on the same level as `_bootstrap.scss` and `main.scss`, and `_variables.scss` is inside the `bootstrap` folder. – Samuel Reid Jul 30 '15 at 13:49
  • What version of Ruby do you have? – Colin Bacon Jul 30 '15 at 13:58
  • `2.2.3`, but I'm not certain whether the WebCompiler extension for Visual Studio uses its own stuff to do compilations. – Samuel Reid Jul 30 '15 at 14:33
  • Can you tell me how you are compiling Sass in 2015. Web Essentials 2015 no longer has compilation. – Colin Bacon Jul 30 '15 at 14:49
  • With another extension called Web Compiler. Web Essentials points users now to that extension for compilation, so I am using both. Web Compiler lets me right click a `.scss` file and click compile, and it's been working fine for me so far with no hiccups, except this one attempt at imports with bootstrap. – Samuel Reid Jul 30 '15 at 14:56
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/84709/discussion-between-samuel-reid-and-colin-bacon). – Samuel Reid Jul 30 '15 at 15:07
  • @ColinBacon Why was this retagged with libsass? The OP says they are using Ruby and Compass (which requires using the Ruby version of Sass). – cimmanon Jul 30 '15 at 16:10
  • @cimmanon The OP is using Web Compiler https://github.com/madskristensen/WebCompiler This compiles with libsass-net which uses libsass. – Colin Bacon Jul 30 '15 at 16:13
  • I am NOT using Compass, Rails, or Bower. I installed Ruby on my machine before starting to use Web Compiler in Visual Studio 2015, so my Ruby installation is irrelevant, since Web Compiler uses libsass. – Samuel Reid Jul 30 '15 at 16:24

0 Answers0