Replace CSS content substitution with theme-specific navbar background images to ensure WebKit repaints the logo when the system color scheme changes. Hide the upstream image while preserving its layout dimensions, and use selectors that prevent Gitea's navbar hover styles from clearing the custom logo.
32 lines
867 B
CSS
32 lines
867 B
CSS
@import "./theme-codecraftsmen-light.css" (prefers-color-scheme: light);
|
|
@import "./theme-codecraftsmen-dark.css" (prefers-color-scheme: dark);
|
|
|
|
html[data-theme="codecraftsmen-auto"] #navbar #navbar-logo {
|
|
background-position: center;
|
|
background-repeat: no-repeat;
|
|
background-size: 60px 30px;
|
|
}
|
|
|
|
html[data-theme="codecraftsmen-auto"] #navbar #navbar-logo img {
|
|
visibility: hidden;
|
|
width: 60px;
|
|
height: 30px;
|
|
}
|
|
|
|
@media (prefers-color-scheme: light) {
|
|
html[data-theme="codecraftsmen-auto"] #navbar #navbar-logo {
|
|
background-image: url("../img/logo-light-no-slogan.svg");
|
|
}
|
|
}
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
html[data-theme="codecraftsmen-auto"] #navbar #navbar-logo {
|
|
background-image: url("../img/logo-dark-no-slogan.svg");
|
|
}
|
|
}
|
|
|
|
gitea-theme-meta-info {
|
|
--theme-display-name: "CodeCraftsmen Auto";
|
|
--theme-color-scheme: "auto";
|
|
}
|