简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM