aboutsummaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-05-28 23:37:34 +0200
committerGitHub <noreply@github.com>2023-05-28 21:37:34 +0000
commitfaf8557b4c537f7348413934c36fe4bbaa99809b (patch)
tree0fb952fc82bf299c7e1931f90a4b216a5be8a399 /web_src
parentacb13afb79a253062bf4ca77b60c61496a7198e4 (diff)
downloadgitea-faf8557b4c537f7348413934c36fe4bbaa99809b.tar.gz
gitea-faf8557b4c537f7348413934c36fe4bbaa99809b.zip
Add dark mode to API Docs (#24971)
Add a dark mode to Swagger UI via CSS `invert`. No toggle or anything, but I think it's better than nothing. Users can toggle via their OS. Also includes a few misc CSS cleanups on the page. <img width="1264" alt="Screenshot 2023-05-28 at 20 25 06" src="https://github.com/go-gitea/gitea/assets/115237/de761b85-ca0c-4220-bee4-73798a4360a0"> <img width="1260" alt="Screenshot 2023-05-28 at 20 02 54" src="https://github.com/go-gitea/gitea/assets/115237/29188ed2-c167-47f5-bf28-46193d1da22c">
Diffstat (limited to 'web_src')
-rw-r--r--web_src/css/standalone/swagger.css23
1 files changed, 17 insertions, 6 deletions
diff --git a/web_src/css/standalone/swagger.css b/web_src/css/standalone/swagger.css
index 5c1902f11f..46b00d34ab 100644
--- a/web_src/css/standalone/swagger.css
+++ b/web_src/css/standalone/swagger.css
@@ -1,12 +1,7 @@
-html {
- box-sizing: border-box;
- overflow-y: scroll;
-}
-
*,
*::before,
*::after {
- box-sizing: inherit;
+ box-sizing: border-box;
}
body {
@@ -24,8 +19,24 @@ body {
align-items: center;
}
+.swagger-back-link:hover {
+ text-decoration: underline;
+}
+
.swagger-back-link svg {
color: inherit;
fill: currentcolor;
margin-right: 0.5rem;
}
+
+@media (prefers-color-scheme: dark) {
+ body {
+ background: #1e1e1e;
+ }
+ .swagger-ui, .swagger-back-link {
+ filter: invert(88%) hue-rotate(180deg);
+ }
+ .swagger-ui .microlight {
+ filter: invert(100%) hue-rotate(180deg);
+ }
+}