jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/865647 )

Change subject: [doc] Add highlighting to targeted code snippet
......................................................................

[doc] Add highlighting to targeted code snippet

Bug: T323800
Change-Id: I62a02a474c3909024ad574a1331e9667c4e17c49
---
M docs/_static/css/pywikibot.css
1 file changed, 43 insertions(+), 0 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/docs/_static/css/pywikibot.css b/docs/_static/css/pywikibot.css
index b3e5ebf..b03fa36 100644
--- a/docs/_static/css/pywikibot.css
+++ b/docs/_static/css/pywikibot.css
@@ -30,6 +30,7 @@
     margin-right: unset;
 }

+/** previous, next, modules, index links in sidebar **/
 .sidebar-rellinks {
     margin-top: -0.25rem;
     padding-bottom: 0.25rem;
@@ -43,3 +44,35 @@
 .sidebar-rellinks a {
     padding: 0.25rem;
 }
+
+/** code highlights for light and dark mode **/
+
+/** light mode by default or if OS picks it **/
+.highlight .viewcode-block:target {
+    background-color: #3331;
+    padding: 0.2rem 0;
+    border: 1px solid #1115;
+}
+
+/** dark mode chosen by the OS **/
+@media (prefers-color-scheme: dark) {
+    .highlight .viewcode-block:target {
+        background-color: #ccc1;
+        padding: 0.2rem 0;
+        border: 1px solid #fff5;
+    }
+}
+
+/** light mode via toggle **/
+[data-theme='light'] .highlight .viewcode-block:target {
+    background-color: #3331;
+    padding: 0.2rem 0;
+    border: 1px solid #1115;
+}
+
+/** dark mode via toggle **/
+[data-theme='dark'] .highlight .viewcode-block:target {
+    background-color: #ccc1;
+    padding: 0.2rem 0;
+    border: 1px solid #fff5;
+}

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/865647
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: tests
Gerrit-Change-Id: I62a02a474c3909024ad574a1331e9667c4e17c49
Gerrit-Change-Number: 865647
Gerrit-PatchSet: 2
Gerrit-Owner: KBach <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to