Creating a collection of variables
One of the main things you'll want to do when using Sass in Bootstrap is to create a library of global variables that can be used throughout your theme. Think of things such as colors, backgrounds, typography, links, borders, margins, and padding. It's best to only define these common properties once and then you can reuse them through different components. Before we go too far, we need to create a new .scss
file. Open up your text editor, create a new file, and call it _variables.scss
. Save that file to the /css/components
directory. For now, you can just leave it blank.
Importing the variables to your custom style sheet
Now that we've created the variables Sass file, we need to import it into our custom style sheet. Open up custom.css
in your text editor and paste the following line of code at the top of the file:
@import "components/_variables.scss";
It's important to note that this file must be at the top of your custom style sheet file. The variables...