Problem
Bootstrap Studio doesn't currently support Sass.
Solution
With some creative workarounds, it's possible to get most of the benefits of Bootstrap Studio combined with a Gulp + Sass + Browsersync workflow.
Setup
File structure
- Create a directory to hold the web-ready files (aka, an "
app
" directory). - Put sass source files in
source/sass
.
Gulp Sass / Browsersync
Set up a standard gulp Sass workflow:
- src:
source/sass/**/*.scss
- dest:
app/assets/css
Use these Browsersync options:
{
server: app,
files: [
"app/*.html",
"app/**/*.js"
]
}
Bootstrap Studio
- Name the page
index.html
- Configure the export settings to export to the
app
directory. - Link external stylesheet
http://localhost:3000/assets/css/styles.css
.
This pulls in the css file(s) that will be served by gulp. - Link external JavaScript
http://localhost:3000/assets/js/whatever.js
.
This pulls in the js file(s) that will be served by gulp.
Workflow
- Run
gulp serve
as usual, using this server as the "preview" instead of the Bootstrap Studio preview. - Make css edits in an external editor. If gulp is set up correctly, they will be recompiled automatically and injected into the preview via BrowserSync as usual.
- Make HTML edits in Bootstrap Studio and export them to see the result in the BrowserSync server. If BrowserSync is set up correctly, the exports will change the files in the
app
directory and trigger a reload.