Add scss file to Stackblitz

Can you tell me how to add a file scssto stackblitz. I have tried this. But it does not work. Please see this and let me know.

I tried to add home.html

This is a project: stackblitz

+3
source share
2 answers

Scss should work on stackblitz :

@Component({
  selector: 'page-home',
  templateUrl: 'home.html',
  styleUrls: [ './home.scss' ] <== add this
})
export class HomePage {

Style styles

 page-home {
 .buttoncls {

will not work for you with default encapsulation ( ViewEncapsulation.Emulated), because it is page-homenot part of the component template home, but angular adds a type attribute [_ngcontent-c0]to the styles.

So, we can change page-hometo ion-listand see how it works:

Stackblitz (ViewEncapsulation.Emulated)

:

encapsulation: ViewEncapsulation.None

Stackblitz (ViewEncapsulation.None)

https://github.com/stackblitz/core/issues/1

EricSimons 9

, ! SASS LESS, angular -cli.json config :)

+8

. :

@Component({
  selector: 'page-home',
  templateUrl: 'home.html',
  styleUrls: [ 'home.scss' ] <== add this
})

- .

0

All Articles