In this recipe, you will learn how to build and maintain your Ionic projects using Sass.
Read the Installing the Ionic Framework recipe of this chapter to find out how to set up a new Ionic project.
In the Installing the Ionic Framework recipe you have learn how to set up the CLI tool, now will learn how to use Sass in your Ionic projects:
Start a new Ionic by running the following command in your console:
ionic start recipe2
Then, navigation to the
recipe2
folder and run the following command in your console to set up Sass:ionic setup sass
Now, start your Ionic app by running the following command in your console:
ionic serve
Open the
scss/ionic.app.scss
file in your text editor and edit the$positive
variable as follows:$positive: #f00 !default; //red
After saving the
scss/ionic.app.scss
file, you will find that your browser automatically reloads. The hyperlinks and other elements are colored red now.