Answer the question
In order to leave comments, you need to log in
Why are styles not loading for Angular2?
I'm trying to load styles, but they are not connected, very strange
import { Component, ViewEncapsulation } from '@angular/core';
declare var $:any;
console.log([`themes/${process.env.THEME}.scss`, 'app.component.scss'])
@Component({
selector: 'my-app', // <my-app></my-app>
templateUrl: './app.component.html',
styleUrls: [`themes/beeline.scss`, 'app.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class AppComponent {
constructor() {
}
}
// all css required in src/app files will be merged in js files
{test: /\.(scss|sass)$/, exclude: root('source', 'style'), loader: 'raw-loader!sass-loader!postcss-loader'},
@Component({
selector: 'my-app', // <my-app></my-app>
templateUrl: './app.component.html',
styleUrls: [
'./app.component.scss',
'/themes/' + process.env.THEME + '.scss'
],
encapsulation: ViewEncapsulation.None
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question