0

I am currently have a site, where all of our CSS files, is being bundled into one file. Problem now is, there is a need to want to add print style for this site, but how do i go about this?

All CSS files is currently included in the main css bundle, meaning that all styles are imported from that one.

I don't wan't make a new CSS bundle for print styles only, is there any way i can include a printstyles in my main css bundle,

And only use that style, when page is being previewed for print?

I am not Fat
  • 283
  • 11
  • 36
  • `@media print { YOUR PRINT CSS }` – Turnip Feb 05 '19 at 12:10
  • Where would you scope/add this in a separate CSS file, and then include it in the main CSS bundle, If so, will that be enough to add print styles ? – I am not Fat Feb 05 '19 at 12:14
  • Add it at the end of your CSS file since you want to overwrite the defaults. – Turnip Feb 05 '19 at 12:24
  • for the main bundle, or each individual?, The main bundle is being compiled/build together, so I would have to inject that pipeline.. No way I can add a css file with the `@media print{}` in a separate Css file, include in the main css bundle, and have it compiled ? – I am not Fat Feb 05 '19 at 12:48
  • I've no idea since I know nothing about your bundling process. Just treat it like any other CSS in your project. – Turnip Feb 05 '19 at 14:15
  • what about how it is included in the html.. Right now it is added as `` there is no media defined here? – I am not Fat Feb 05 '19 at 14:50

1 Answers1

0

If you want to use the same CSS you can target print layouts with a media query

@media print {
  .snig { 
     display: none;
   }
}
oel
  • 77
  • 5