In /blob/master/thumbnail/textcreator.cpp background color is hard-coded, but font color is automatic, which can lead to white text on white background.
https://invent.kde.org/network/kio-extras/-/blob/master/thumbnail/textcreator.cpp
https://invent.kde.org/network/kio-extras/-/blob/master/thumbnail/textcreator.cpp
line 131: QColor bgColor = QColor ( 245, 245, 245 ); // light-grey background
This is where the background color is hard-coded.
The font color is probably coming from one of these two lines:
line 142: textDocument.setDefaultFont(font);
line 147: textDocument.setDefaultTextOption(textOption);
Having the font color of text file thumbnails automatically determined by the system theme while the background color is hard-coded can lead to both colors being the same -- or at least very similar -- which makes the text very difficult to see and impossible to read. This is especially likely when selecting a dark/night theme, which usually involves placing a light text on a dark background as the default.
I think a line at about line 92 could fix this -- set the font
variable to include something like font.setColor( QColor ( 0, 0, 0,) );
(Since the background color is hard-coded, the default font color should probably also be hard-coded to match.)
I wish I knew the exact syntax for setting the font color in this kind of framework.