2
$\begingroup$

I'm trying to make a custom dark mode stylesheet, and I started with Kuba's great DarkPackage.

The issue is how to deal with text in panels (you can barely see the white-on-white text, unless you select the element with your mouse):

enter image description here

My question: how to control the color of text in paneled boxes from a stylesheet definition cell?

The most common examples of this are:

  1. White text in values of InformationPanel[title, {key->value, ...}] from GeneralUtilities` (e.g. the panel used in Classify, NetTrain, Information, etc.):

enter image description here

  1. White text in headers of datasets:

enter image description here

  1. Linguistic assistant text:

enter image description here

These are just a few cases of this need to invert the white colors on white paneled or interactive backgrounds, but at least addressing these two would solve most of the problem.

What I've tried:

One really bad way to solve this is to set:

Cell[StyleData["Notebook"], FontColor->RGBColor[0, 0.7, 1]]

Which will fix the unreadable panels, but will affect all Text :(

enter image description here

$\endgroup$
  • $\begingroup$ You need to have some box style that you can edit. Something like a class or tag in the CSS world, basically. That means you need to look into how Information makes its boxes and mess with that. $\endgroup$ – b3m2a1 Feb 17 at 0:57
2
$\begingroup$

Editing the "DialogStyle" cell style works for the Information case. In general you need to look at where the BoxObject of interest will inherit its styles from. In this case I just did ToBoxes[Information[a]] and figured it out like that.

StyleSheetEdit[
 "DialogStyle",
 FontColor -> Red,
 "MakeCell" -> True
 ]
Information[a]

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ What about text in the linguistic assistant? $\endgroup$ – M.R. Feb 17 at 1:59
  • $\begingroup$ The raw text doesn't have it bound, but the NamespaceBox inherits styles it seems. Styling "LinguisticAssistant" works. I'd be careful about messing with that one, though. The Wolfram Alpha people hard coded a lot of shit. $\endgroup$ – b3m2a1 Feb 17 at 2:07
  • $\begingroup$ Ah and "NaturalLanguageInput" $\endgroup$ – M.R. Feb 17 at 2:07
  • $\begingroup$ Where is "NaturalLanguageInput" used? $\endgroup$ – b3m2a1 Feb 17 at 2:08
  • $\begingroup$ I found it by text searching in default/core/.. $\endgroup$ – M.R. Feb 17 at 2:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.