DIY Make line numbers use alternative styles
This is one of our practical examples to override the semantic colors of the Modus themes (Stylistic variants using palette overrides). In this section we show how to affect the display-line-numbers-mode.
emacs-lisp
;; Make line numbers less intense
(setq modus-themes-common-palette-overrides
'((fg-line-number-inactive "gray50")
(fg-line-number-active fg-main)
(bg-line-number-inactive unspecified)
(bg-line-number-active unspecified)))
;; Like the above, but use a shade of red for the current line number
(setq modus-themes-common-palette-overrides
'((fg-line-number-inactive "gray50")
(fg-line-number-active red-cooler)
(bg-line-number-inactive unspecified)
(bg-line-number-active unspecified)))
;; Make all numbers more intense, use a more pronounce gray
;; background, and make the current line have a colored background
(setq modus-themes-common-palette-overrides
'((fg-line-number-inactive fg-main)
(fg-line-number-active fg-main)
(bg-line-number-inactive bg-inactive)
(bg-line-number-active bg-cyan-intense)))Reload the theme for changes to take effect.