How to Fix Black Background for TXT Files in SharePoint
Question details
Users need to resolve an issue where plain text files display with a dark background and gray text.

- Product
- SharePoint
- Device & OS
- not provided
- Scenario
- Viewing TXT files in a SharePoint environment that utilizes a dark theme.
- Observed behavior
- The SharePoint dark theme incorrectly applies a black background and gray text to TXT files, making them difficult to read.
Verify your current SharePoint site theme settings and confirm whether this dark background behavior is isolated to plain text (TXT) files or if it affects other file types as well.
Request Developer Assistance in Microsoft Q&A
Because this display issue is caused by SharePoint's page-development and theming architecture rather than a standard file setting, you must consult specialized Microsoft support.
A dark SharePoint theme automatically forces a black background and gray text onto plain text (TXT) files. Since this behavior is tied deeply to the theme palette and site development, it cannot be turned off via standard document library options.
Collect your current SharePoint theme palette, custom colors, and note the specific affected file behavior.
Go to the official Microsoft Q&A forum at https://learn.microsoft.com/en-us/answers/.
Create a new question and include the tags 'SharePoint development' or 'Microsoft Graph' to ensure your question reaches the correct theming experts.

Manage Your Documents Seamlessly with WPS Office
Avoid unexpected display overrides like the SharePoint dark theme issue by managing your documents locally. WPS Office is a highly compatible, free, and lightweight alternative to Microsoft Office that ensures your text documents are displayed correctly.
- 1. Download the Software: Visit the official WPS website and download the free WPS Office suite.
- 2. Install WPS Office: Run the installer and follow the on-screen instructions to set up the software on your device.
- 3. Open Your Text Files: Launch WPS Writer to open your TXT or DOCX files and view them with perfectly preserved formatting and backgrounds.

Frequently Asked Questions
Why do my TXT files have a black background in SharePoint?
This happens when a dark theme is applied to your SharePoint site. The SharePoint theming engine automatically overrides the background of plain text (TXT) files, changing the background to black and the text to gray.
Can I fix the dark background by changing TXT file settings?
No. The black background is controlled by SharePoint page-development and theming behaviors. It cannot be resolved by modifying standard file properties or document library settings.
What is the best workaround to display text with a white background in SharePoint?
The simplest workaround is to convert your plain text files into DOCX or PDF formats before uploading them. These formats maintain their original document background colors regardless of the site's dark theme.




