Skip to content

Commit 51cce23

Browse files
V15: Allows certain adjustments of the logo (#18499)
* feat: uses the app-logo component to show the large logo * feat: rename and publish CSS variables to modify the logo * feat: sets size of logo to 55px to match login screen * feat: adds css variables to customize the dimensions of the login logo * fix: uses `ifDefined` in case logo is not defined * fix: uses the intrinsic logo path from `when()` * Fixed up import types * uses the intrinsic alternative logo path from `when()` * feat: changes logo based on theme * feat: forces dark theme on the header logo * feat: adds blue logomark * feat: adds logo-alternative path to the backend * chore: minify logos * feat: optimises logo sizes --------- Co-authored-by: leekelleher <leekelleher@gmail.com>
1 parent 865a2cd commit 51cce23

13 files changed

Lines changed: 331 additions & 424 deletions

File tree

src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeGraphicsController.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ namespace Umbraco.Cms.Api.Management.Controllers.Security;
1919
public class BackOfficeGraphicsController : Controller
2020
{
2121
public const string LogoRouteName = nameof(BackOfficeGraphicsController) + "." + nameof(Logo);
22+
public const string LogoAlternativeRouteName = nameof(BackOfficeGraphicsController) + "." + nameof(LogoAlternative);
2223
public const string LoginBackGroundRouteName = nameof(BackOfficeGraphicsController) + "." + nameof(LoginBackground);
2324
public const string LoginLogoRouteName = nameof(BackOfficeGraphicsController) + "." + nameof(LoginLogo);
2425
public const string LoginLogoAlternativeRouteName = nameof(BackOfficeGraphicsController) + "." + nameof(LoginLogoAlternative);
@@ -44,6 +45,11 @@ public BackOfficeGraphicsController(IOptions<ContentSettings> contentSettings, I
4445
[MapToApiVersion("1.0")]
4546
public IActionResult Logo() => HandleFileRequest(_contentSettings.Value.BackOfficeLogo);
4647

48+
[HttpGet("logo-alternative", Name = LogoAlternativeRouteName)]
49+
[AllowAnonymous]
50+
[MapToApiVersion("1.0")]
51+
public IActionResult LogoAlternative() => HandleFileRequest(_contentSettings.Value.BackOfficeLogoAlternative);
52+
4753
[HttpGet("login-logo", Name = LoginLogoRouteName)]
4854
[AllowAnonymous]
4955
[MapToApiVersion("1.0")]
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 51 deletions
Loading
Lines changed: 1 addition & 51 deletions
Loading

src/Umbraco.Core/Configuration/Models/ContentSettings.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class ContentSettings
2323
internal const string StaticLoginLogoImage = "assets/logo_light.svg";
2424
internal const string StaticLoginLogoImageAlternative = "assets/logo_dark.svg";
2525
internal const string StaticBackOfficeLogo = "assets/logo.svg";
26+
internal const string StaticBackOfficeLogoAlternative = "assets/logo_blue.svg";
2627
internal const bool StaticHideBackOfficeLogo = false;
2728
internal const bool StaticDisableDeleteWhenReferenced = false;
2829
internal const bool StaticDisableUnpublishWhenReferenced = false;
@@ -88,9 +89,18 @@ public class ContentSettings
8889
/// <summary>
8990
/// Gets or sets a value for the path to the backoffice logo.
9091
/// </summary>
92+
/// <remarks>The alternative version of this logo can be found at <see cref="BackOfficeLogoAlternative"/>.</remarks>
9193
[DefaultValue(StaticBackOfficeLogo)]
9294
public string BackOfficeLogo { get; set; } = StaticBackOfficeLogo;
9395

96+
/// <summary>
97+
/// Gets or sets a value for the path to the alternative backoffice logo, which can be shown
98+
/// on top of a light background.
99+
/// </summary>
100+
/// <remarks>This is the alternative version to the regular logo found at <see cref="BackOfficeLogo"/>.</remarks>
101+
[DefaultValue(StaticBackOfficeLogoAlternative)]
102+
public string BackOfficeLogoAlternative { get; set; } = StaticBackOfficeLogoAlternative;
103+
94104
/// <summary>
95105
/// Gets or sets a value indicating whether to hide the backoffice umbraco logo or not.
96106
/// </summary>

0 commit comments

Comments
 (0)