mui / mui/material-ui

Provide a way to specify default theme for printing

Open
#36,325 3 comments 1 reaction 1 assignee View on GitHub

@siriwatknp is already working on this.

Since Feb 27, 2023.

customization: theme scope: all components type: enhancement
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the latest version
Summary 💡

In my app, I have support for light and dark themes.
When I initiate printing with window.print() I want the default light theme to be used regardless if the current displed theme is dark or light.

I tried to work around this by using useMediaQuery('print') and setting the theme to light but it does not work with window.print() only on Ctrl+P.

I also tried experimental CssVariables color schemas and if you would add the ability to specify media property for injected global stylesheets that may solve the issue.

Examples 🌈

No response

Motivation 🔦

It does not make sense to print pages on a dark theme because you will use a lot of ink for printing.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.