1
1
mirror of https://github.com/go-gitea/gitea synced 2024-11-17 23:54:25 +00:00
gitea/web_src/css/standalone/swagger.css
silverwind faf8557b4c
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">
2023-05-28 21:37:34 +00:00

43 lines
651 B
CSS

*,
*::before,
*::after {
box-sizing: border-box;
}
body {
margin: 0;
background: #fff;
}
.swagger-back-link {
color: #1f69c0;
text-decoration: none;
position: absolute;
top: 1rem;
right: 1.5rem;
display: flex;
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);
}
}