Next: , Previous: , Up: DIY Stylistic variants using palette overrides   [Index]

7.2.19 DIY Make the region preserve text colors, plus other styles

This is one of our practical examples to override the semantic colors of the Modus themes (Stylistic variants using palette overrides). Here we show how to make the region respect the underlying text colors or how to make the background more/less intense while combining it with an appropriate foreground value.

Do not extend the region background.

;; A background with no specific foreground (use foreground of
;; underlying text)
(setq modus-themes-common-palette-overrides
      '((bg-region bg-ochre) ; try to replace `bg-ochre' with `bg-lavender', `bg-sage'
        (fg-region unspecified)))

;; Subtle gray with a prominent blue foreground
(setq modus-themes-common-palette-overrides
      '((bg-region bg-dim)
        (fg-region blue-cooler)))

;; Intense magenta background combined with the main foreground
(setq modus-themes-common-palette-overrides
      '((bg-region bg-magenta-intense)
        (fg-region fg-main)))

Reload the theme for changes to take effect.