Utilizing Scss in StackBlitz:
@Component({
selector: 'page-home',
templateUrl: 'home.html',
styleUrls: [ './home.scss' ] <== remember to include this line
})
export class HomePage {
CSS styles targeting elements like
page-home {
.buttoncls {
may not work as expected with default encapsulation (ViewEncapsulation.Emulated
) due to Angular's attribute additions like [_ngcontent-c0]
to styles.
An alternative is to switch page-home
to ion-list
and observe the changes:
Example on StackBlitz (ViewEncapsulation.Emulated)
Alternatively, you can disable encapsulation using:
encapsulation: ViewEncapsulation.None
Example on StackBlitz (ViewEncapsulation.None)
Reference this thread for more information:
https://github.com/stackblitz/core/issues/1
Recent comment by EricSimons:
Exciting news! SASS and LESS support has been added, along with compatibility with angular-cli.json configuration file :)