Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Word docs created don't work well in Dark Mode by default #1093

Closed
jacwright opened this issue Aug 12, 2021 · 5 comments · Fixed by #1285
Closed

Word docs created don't work well in Dark Mode by default #1093

jacwright opened this issue Aug 12, 2021 · 5 comments · Fixed by #1285

Comments

@jacwright
Copy link
Contributor

When a Word doc is created in Microsoft Word, it has no background color defined. This allows it to work well in Dark Mode on devices that support it. docx adds a background color by default, and trying to override it with null or an empty string doesn't remove it.

We need a way to remove the background color and it really shouldn't have one by default. Here is a screenshot of 2 documents in Dark Mode. The left document was created by docx, the right document was created by Word. They both look normal in light mode, but they don't work well in dark mode. See how Word inverts the text color, but not the background color?

Screen Shot 2021-08-12 at 11 41 21 AM

@dolanmiu
Copy link
Owner

I thought this would be a simple feature, but it seems like it requires a big "dark mode" integration?

http://officeopenxml.com/prSlide-color.php

@kptdobe
Copy link

kptdobe commented Sep 13, 2021

Big +1.
And as a temporary workaround, you can manually "fix" the generated docx: go to Design > Page Colour and set No Colour.

@Chrilla
Copy link

Chrilla commented Oct 28, 2021

@dolanmiu Is this something you're working on currently and expect to release in the near future?

@dolanmiu
Copy link
Owner

dolanmiu commented Nov 1, 2021

Not something i'm working on, happy to review a pull request into this though

erlend-axelsson added a commit to erlend-axelsson/docx that referenced this issue Nov 12, 2021
After comparing the output of this library and what is
produced by Microsoft Word, it seems that document
background color is not set by default by Word.

Removing the default #FFFFFF background color enables the
generated documents to be readable in dark mode.

This seems to fix dolanmiu#1093
@erlend-axelsson
Copy link
Contributor

@dolanmiu I might be missing some big gotchas, but from my testing it seems like the pull request solves the dark mode issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants