How do you create application to use scss ?
How do you create application to use scss ?
To create an Angular application that uses SCSS for styling, you can follow these steps:
First, you need to create a new Angular project. Open your terminal, navigate to the directory where you want to create your project, and run the Angular CLI command:
ng new my-project
Replace my-project with the desired name of your project. This command will create a new directory with your project's name and generate all the necessary files and folders for an Angular project.
Next, you need to install Sass in your Angular project. Navigate to your project directory and run the following command:
npm install sass
This will install Sass as a development dependency in your project.
To configure Angular to use Sass, you need to modify the angular.json file in the root of your project. Open the file and locate the projects > [project-name] > architect > build > options section. Add the following property:
"stylePreprocessorOptions": {
"includePaths": ["src/styles"]
}
This tells Angular to look for Sass files in the src/styles directory.
Now that Angular is configured to use Sass, you can create a Sass file in your project. Create a new file with the .scss extension in the src/styles directory or any other directory specified in the stylePreprocessorOptions property in the angular.json file. For example, you might create a file named styles.scss.
Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.