From a485baf7d27efa694f5559296b4cf8500d911b39 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sun, 13 Aug 2017 15:14:12 +0200 Subject: [PATCH] Switch styles to SASS. --- package.json | 2 ++ src/app.module.ts | 2 +- src/main.scss | 10 ++++++---- webpack.config.js | 7 +++++++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4f2b21f..b82bdf2 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,8 @@ "less-loader": "^4.0.5", "loglevel": "^1.4.1", "ngtemplate-loader": "^2.0.1", + "node-sass": "^4.5.3", + "sass-loader": "^6.0.6", "style-loader": "^0.18.2", "ts-loader": "^2.3.2", "typescript": "^2.4.2", diff --git a/src/app.module.ts b/src/app.module.ts index b4123ca..48d4d72 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -2,7 +2,7 @@ import 'zone.js'; import 'reflect-metadata'; -require('./main.less'); +require('./main.scss'); import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; diff --git a/src/main.scss b/src/main.scss index ba7ea90..abef40c 100644 --- a/src/main.scss +++ b/src/main.scss @@ -1,10 +1,12 @@ -@import '~font-awesome/less/font-awesome'; +$fa-font-path: '~font-awesome/fonts'; -@import (inline) '~bootstrap/dist/css/bootstrap.css'; +@import '~font-awesome/scss/font-awesome'; -@import (inline) '~c3/c3.css'; +@import '~bootstrap/scss/bootstrap'; -@import (inline) '~ngx-toastr/toastr.css'; +@import '~c3/c3'; + +@import '~ngx-toastr/toastr'; .italic { font-style: italic; diff --git a/webpack.config.js b/webpack.config.js index 097cbe3..a633140 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -79,6 +79,13 @@ module.exports = { 'style-loader', 'css-loader', ] + }, { + test: /\.scss$/, + use: [ + 'style-loader', + 'css-loader', + 'sass-loader', + ] }, { test: /\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000'