typora-issues icon indicating copy to clipboard operation
typora-issues copied to clipboard

[Feature] Allow printing with print-ready dark themes (like Typora Themeable)

Open jhildenbiddle opened this issue 2 years ago • 0 comments

Typora currently displays the following warning when attempting to print while using a "dark" theme variant:

CleanShot 2022-08-25 at 10 13 31@2x

This dialog prevents printing unnecessarily in the following scenarios:

  1. When a theme auto-switches between light and dark mode variants based on the OS-level preference. In this scenario, the default (or prefers-color-scheme: light) styles will be used for printing even when the OS is displaying content on the screen in dark mode:
    body {
       background: white;
       color: black;
    }
    
    @media screen and (prefers-color-scheme: dark) {
        body {
          background: black;
          color: white;
        }
    }
    
  2. When a dark theme includes @media print styles that make it suitable for printing:
    body {
       background: black;
       color: white;
    }
    
    @media print {
        body {
          background: black;
          color: white;
        }
    }
    

Typora Themeable is one example of a theme that does both of these things, and as a result both the auto-switching variant (themeable.css) and dark-only variant (theme able-dark.css) are prevented from printing unnecessarily.

A few suggestions:

  • Instead of preventing users from printing when using a dark theme, warn them that their current "dark" theme may not be optimized for printing but give them the option to proceed anyway. In most operating systems a print preview will be displayed before printing occurs which will allow users to determine if their theme is print-compatible.
  • Provide users with a "don't show me this warning again" option so they don't have to see the above warning every time they print with a dark theme.
  • Let users select a theme for printing within the app preferences the same way the can for exports. I was surprised this was not already possible given that the "Export" preference pane includes an icon of a printer. CleanShot 2022-09-09 at 10 10 59@2x
  • Consider presenting users with print/export options via a dialog when they print/export. This would increase awareness of print/export-related preferences that users may otherwise be unaware of and allow them to modify these settings for each print/export job.

Happy to discuss further and work out the details. Thx!

jhildenbiddle avatar Sep 09 '22 15:09 jhildenbiddle