mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Support separate header logo images for light and dark themes (#36362)
Server Pro/CE admins can set a custom header logo via OVERLEAF_HEADER_IMAGE_URL, but the same image is used for both the light and dark navbar themes. A logo with good contrast on one background can be hard to see on the other (e.g. a dark logo on the dark dashboard navbar). Add two optional env vars, OVERLEAF_HEADER_IMAGE_URL_LIGHT and OVERLEAF_HEADER_IMAGE_URL_DARK, each falling back to OVERLEAF_HEADER_IMAGE_URL when unset, so existing configurations are unaffected. The light/dark fallback is resolved server-side and exposed to the frontend as customLogo (light-effective) and customLogoDark (dark-effective); the two theme-aware navbars (project dashboard and library) pick between them using the existing overall-theme hook, so the logo tracks both the user's theme setting and live OS theme changes. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> GitOrigin-RevId: 587a5679c650717cba6251e6d612146f434e8730
This commit is contained in:
committed by
Copybot
co-authored by
Claude Opus 4.8
parent
b4b12caf48
commit
42b29f0107
@@ -22,7 +22,8 @@ block append meta
|
||||
name='ol-navbar'
|
||||
data-type='json'
|
||||
content={
|
||||
customLogo: settings.nav.custom_logo,
|
||||
customLogo: settings.nav.custom_logo_light || settings.nav.custom_logo,
|
||||
customLogoDark: settings.nav.custom_logo_dark || settings.nav.custom_logo,
|
||||
title: nav.title,
|
||||
canDisplayAdminMenu,
|
||||
canDisplayAdminRedirect,
|
||||
|
||||
@@ -9,12 +9,13 @@ nav.navbar.navbar-default.navbar-main.navbar-expand-lg(
|
||||
)
|
||||
.container-fluid.navbar-container
|
||||
.navbar-header
|
||||
- var customLogo = settings.nav.custom_logo_light || settings.nav.custom_logo
|
||||
a.navbar-brand(href='/' aria-label=settings.appName)
|
||||
if settings.nav.custom_logo
|
||||
.navbar-logo(style=`background-image:url("${settings.nav.custom_logo}")`)
|
||||
if customLogo
|
||||
.navbar-logo(style=`background-image:url("${customLogo}")`)
|
||||
if nav.title
|
||||
.navbar-title #{nav.title}
|
||||
if !nav.title && !settings.nav.custom_logo
|
||||
if !nav.title && !customLogo
|
||||
.navbar-logo
|
||||
|
||||
- var enableUpgradeButton = projectDashboardReact && usersBestSubscription && (usersBestSubscription.type === 'free' || usersBestSubscription.type === 'standalone-ai-add-on')
|
||||
|
||||
@@ -78,6 +78,11 @@ export function ProjectListDsNav() {
|
||||
<SystemMessages />
|
||||
<DefaultNavbar
|
||||
{...navbarProps}
|
||||
customLogo={
|
||||
activeOverallTheme === 'dark'
|
||||
? navbarProps.customLogoDark
|
||||
: navbarProps.customLogo
|
||||
}
|
||||
overleafLogo={
|
||||
activeOverallTheme === 'dark' ? overleafLogoDark : overleafLogo
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import type {
|
||||
|
||||
export type DefaultNavbarMetadata = {
|
||||
customLogo?: string
|
||||
customLogoDark?: string
|
||||
title?: string
|
||||
canDisplayAdminMenu: boolean
|
||||
canDisplayAdminRedirect: boolean
|
||||
|
||||
Reference in New Issue
Block a user