Change logo CSS size or introduce option to control size

Created on 23 September 2024, 3 months ago

Problem/Motivation

Currently when adding a logo to the site, you get the joy of being able to add it and have it render on screen as expected. However, that joy can be a bit diminished as it:

  • doesn't offer any controls for the size
  • forces the image to a set size
  • limits padding/margin out of the box

For those working in a government context, there are some minimum requirements for things like logos, which is detailed in https://www.pmc.gov.au/sites/default/files/resource/download/australian-...

While this can be changed via CSS, there's not an easy way to adjust this within Appearance when trying to get something out the door quickly. As this is usually a minor branding change needed quickly and usually done by less technical site managers or content people not having options makes a simple task a bit more painful than needed.

Steps to reproduce

  1. Login to site and browse to Appearance
  2. Under Components, then Primary logo and Secondary logo, upload relevant logos
  3. If needed, clear the cache. Browse to a page on the site. See logo presented

Proposed resolution

Option 1: Increase the default values of the image

A simple change in CSS would make the logo larger and introduce some more space, for example:

.ct-logo .ct-logo__image {
	max-height: 4.5rem;
	margin: 0.5rem;
}

A further bit of code:

.ct-header__top .container .row {
	display: flex;
	justify-content: center;
	align-items: center;
}

Could vertically center the menu in that same region resulting in:

Option 2: Provide settings to control image and padding/margin within Appearance
Taking a more user controlled approach, possibly the introduction of some fields alongside the logo options could give more flexibility. Having fields is more work to build but gives end users more control. An example:

Remaining tasks

User interface changes

Potentially new fields depending on the option selected above.

API changes

N/A

Data model changes

N/A

Feature request
Status

Active

Version

1.8

Component

Code

Created by

🇦🇺Australia thisisalistairsaccount

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024