From 407ce2cae37fec956fdf8354822ff07f10e8c316 Mon Sep 17 00:00:00 2001 From: "Ashwin V. Mohanan" Date: Tue, 1 Oct 2024 11:55:45 +0200 Subject: [PATCH] Use a custom selection bg color --- sphinx_lesson/_static/sphinx_lesson.css | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/sphinx_lesson/_static/sphinx_lesson.css b/sphinx_lesson/_static/sphinx_lesson.css index 14b20c6..4378437 100644 --- a/sphinx_lesson/_static/sphinx_lesson.css +++ b/sphinx_lesson/_static/sphinx_lesson.css @@ -1,4 +1,7 @@ /* sphinx_lesson.css */ +:root { + --sphinx-lesson-selection-bg-color: #fce762; +} body.wy-body-for-nav img.with-border { border: 2px solid; @@ -49,3 +52,28 @@ body.wy-body-for-nav img.with-border { .rst-content .admonition.toggle-hidden { padding-bottom: 0px; } + +/* selection / highlight colour uses a yellow background and a black text */ +/*** Works on common browsers ***/ +::selection { + background-color: var(--sphinx-lesson-selection-bg-color); +} + +/*** Mozilla based browsers ***/ +::-moz-selection { + background-color: var(--sphinx-lesson-selection-bg-color); +} + +/***For Other Browsers ***/ +::-o-selection { + background-color: var(--sphinx-lesson-selection-bg-color); +} + +::-ms-selection { + background-color: var(--sphinx-lesson-selection-bg-color); +} + +/*** For Webkit ***/ +::-webkit-selection { + background-color: var(--sphinx-lesson-selection-bg-color); +}