fix(theme): refresh navbar logo on iOS Safari
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.
This commit is contained in:
@@ -1,19 +1,27 @@
|
|||||||
@import "./theme-codecraftsmen-light.css" (prefers-color-scheme: light);
|
@import "./theme-codecraftsmen-light.css" (prefers-color-scheme: light);
|
||||||
@import "./theme-codecraftsmen-dark.css" (prefers-color-scheme: dark);
|
@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) {
|
@media (prefers-color-scheme: light) {
|
||||||
html[data-theme="codecraftsmen-auto"] #navbar-logo img {
|
html[data-theme="codecraftsmen-auto"] #navbar #navbar-logo {
|
||||||
content: url("../img/logo-light-no-slogan.svg");
|
background-image: url("../img/logo-light-no-slogan.svg");
|
||||||
width: 60px;
|
|
||||||
height: 30px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
html[data-theme="codecraftsmen-auto"] #navbar-logo img {
|
html[data-theme="codecraftsmen-auto"] #navbar #navbar-logo {
|
||||||
content: url("../img/logo-dark-no-slogan.svg");
|
background-image: url("../img/logo-dark-no-slogan.svg");
|
||||||
width: 60px;
|
|
||||||
height: 30px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -293,8 +293,15 @@ gitea-theme-meta-info {
|
|||||||
--cc-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
--cc-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
html[data-theme="codecraftsmen-dark"] #navbar-logo img {
|
html[data-theme="codecraftsmen-dark"] #navbar #navbar-logo {
|
||||||
content: url("../img/logo-dark-no-slogan.svg");
|
background-image: url("../img/logo-dark-no-slogan.svg");
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 60px 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
html[data-theme="codecraftsmen-dark"] #navbar #navbar-logo img {
|
||||||
|
visibility: hidden;
|
||||||
width: 60px;
|
width: 60px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -269,8 +269,15 @@ gitea-theme-meta-info {
|
|||||||
--cc-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
--cc-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
html[data-theme="codecraftsmen-light"] #navbar-logo img {
|
html[data-theme="codecraftsmen-light"] #navbar #navbar-logo {
|
||||||
content: url("../img/logo-light-no-slogan.svg");
|
background-image: url("../img/logo-light-no-slogan.svg");
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 60px 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
html[data-theme="codecraftsmen-light"] #navbar #navbar-logo img {
|
||||||
|
visibility: hidden;
|
||||||
width: 60px;
|
width: 60px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user