I want to set different background colors for various cell styles (e.g. Section, Text), so that whenever I choose a specific style for some cell in the notebook, it automatically gets colored accordingly. Is this possible to do via evaluating a single simple command inside the notebook?
I've tried, for example, Cell[StyleData["Text"], Background -> Gray], but it doesn't work at all. Is there a way to use SetOptions for this?



cell background color. – bbgodfrey May 29 '21 at 23:44SetOptions[#, Background -> Blue] & /@ Cells[CellStyle -> "Section"], but it needs to be evaluated every time the new Section cell is created. – AMA May 30 '21 at 04:00private stylesheetto accomplish this, because it appears that defined styles from the Default stylesheet, when being entered, override your command,SetOptions[#, Background -> Gray] & /@ Cells[EvaluationNotebook[], CellStyle -> "Text"]. Only after they are entered into your Notebook does your command apply when executed later. Warning: I am no expert on this topic. – bbgodfrey May 30 '21 at 14:12