Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include media (print|screen) on angular-cli.json

I want to configure materialize(css) on media=screen and bootstrap(css) on media=print, but I don't know doing it through angular-cli.json. Is this possible?

like image 658
Mario Avatar asked Feb 07 '17 03:02

Mario


1 Answers

Currently this is not unavailable from angular-cli.json , there is already issue related to this , so basic workaround this is to add the css files to the index.html ,another way is by ussing the css import as an example :

@import url("fineprint.css") print;
@import url("bluish.css") speech;
@import 'custom.css';
@import url("chrome://communicator/skin/");
@import "common.css" screen;
@import url('landscape.css') screen and (orientation:landscape);

but this give me a diffrent error in angular so my final soultion like this :

@media print {
     @import '/assests/print.css';
} 

@media screen {
     @import '/assests/screen.css';  
}

stackblitz example

MDN @import

like image 128
Muhammed Albarmavi Avatar answered Nov 16 '22 04:11

Muhammed Albarmavi