|
1 | | -/* sphinx_lesson.css */ |
| 1 | +/* sphinx_lesson.css |
| 2 | + * https://webaim.org/resources/contrastchecker/?fcolor=00000&bcolor=FCE762 |
| 3 | + * */ |
| 4 | +:root { |
| 5 | + --sphinx-lesson-selection-bg-color: #fce762; |
| 6 | + --sphinx-lesson-selection-fg-color: #000000; |
| 7 | +} |
| 8 | + |
| 9 | +/* https://webaim.org/resources/contrastchecker/?fcolor=FFFFFF&bcolor=745315 |
| 10 | + * when dark theme is selected the some themes use this attirbute |
| 11 | + */ |
| 12 | +html[data-theme='dark'], body[data-theme='dark'] { |
| 13 | + --sphinx-lesson-selection-bg-color: #745315; |
| 14 | + --sphinx-lesson-selection-fg-color: #ffffff; |
| 15 | +} |
| 16 | + |
| 17 | +/* when browser/system theme is dark and no theme is selected */ |
| 18 | +@media (prefers-color-scheme: dark) { |
| 19 | + html[data-theme='auto'], body[data-theme='auto'] { |
| 20 | + --sphinx-lesson-selection-bg-color: #745315; |
| 21 | + --sphinx-lesson-selection-fg-color: #ffffff; |
| 22 | + } |
| 23 | +} |
2 | 24 |
|
3 | 25 | body.wy-body-for-nav img.with-border { |
4 | 26 | border: 2px solid; |
@@ -49,3 +71,33 @@ body.wy-body-for-nav img.with-border { |
49 | 71 | .rst-content .admonition.toggle-hidden { |
50 | 72 | padding-bottom: 0px; |
51 | 73 | } |
| 74 | + |
| 75 | +/* selection / highlight colour uses a yellow background and a black text */ |
| 76 | +/*** Works on common browsers ***/ |
| 77 | +::selection { |
| 78 | + background-color: var(--sphinx-lesson-selection-bg-color); |
| 79 | + color: var(--sphinx-lesson-selection-fg-color); |
| 80 | +} |
| 81 | + |
| 82 | +/*** Mozilla based browsers ***/ |
| 83 | +::-moz-selection { |
| 84 | + background-color: var(--sphinx-lesson-selection-bg-color); |
| 85 | + color: var(--sphinx-lesson-selection-fg-color); |
| 86 | +} |
| 87 | + |
| 88 | +/***For Other Browsers ***/ |
| 89 | +::-o-selection { |
| 90 | + background-color: var(--sphinx-lesson-selection-bg-color); |
| 91 | + color: var(--sphinx-lesson-selection-fg-color); |
| 92 | +} |
| 93 | + |
| 94 | +::-ms-selection { |
| 95 | + background-color: var(--sphinx-lesson-selection-bg-color); |
| 96 | + color: var(--sphinx-lesson-selection-fg-color); |
| 97 | +} |
| 98 | + |
| 99 | +/*** For Webkit ***/ |
| 100 | +::-webkit-selection { |
| 101 | + background-color: var(--sphinx-lesson-selection-bg-color); |
| 102 | + color: var(--sphinx-lesson-selection-fg-color); |
| 103 | +} |
0 commit comments