JavaScript functionality to enable print based CSS rules and external stylesheets. Any screen media style rules are disabled.

Useful for previewing print layout and for reviewing end-to-end test print screenshots.

Simulating print media does the following:

  • Enables <link rel="stylesheet" href="print.css" media="print">
  • Enables @media print
  • Disables <link rel="stylesheet" href="screen.css" media="screen">
  • Disables @media screen

Example

Example print CSS toggle
Example print CSS toggle