So if your anything like me you might have swapped themes to Understrap knowing only of CSS styling.
The documentation for Understrap is supremely unhelpful for people who have never heard of SASS or SCSS before.
Thus I have created a simple guide on how to compile styles for Understrap!
Set – Up
- Download and install Visual Studio Code from here.
- In the Left-hand Bar, open up the Extensions menu (Ctrl+Shift+X).
- Search for Live Sass Compiler by Ritwick Dey and Install.
- On the blue bar at the bottom of the window, there should now be an eye icon that says “Watch Sass”.
- Still on the Live Sass Compiler extension page, click the cog near the “disable” and “uninstall” buttons, and go to settings.
- In the “Live Sass Compiler” section, under “Format” there will be an option to change the “Settings.json” file.
- Change the “savePath” variable to wherever you wish the final CSS to export to and save (I just leave it as the default).
- In the “Gulp” section, turn on Gulp Auto Detect.
- Open the SCSS or SASS file you wish to compile (In Understrap’s case it should be “sass/theme/_child_theme_variables.scss”)
- Click the eye icon that says “Watch Sass” to compile.
- Once it has changed to “Watching Sass”, It has compiled. There should be an output window with details.
- You can either click it again to turn the extension off or leave it on. When you save the SCSS or SASS file after having made changes while the extensions is “Watching Sass” it will automatically compile it to CSS.
Overwriting Old CSS
If you did everything like I did then within “understrap-child\sass” you should find the CSS file “child-theme”.
- Copy this file to “understrap-child\css” overwriting the old file with the same name.
- Copy the same file (after renaming it “child-theme.min”) to “understrap-child\css” overwriting the old file with the same name.
Congratulations you have managed to do what in any other theme would have taken you 5 seconds!
Hopefully this guide helped.
It definitely helped me when I got someone else to figure out how to do it for me.