Essential - header logo image not responsive

Essential - header logo image not responsive

by Floyd Saner -
Number of replies: 6

I'm using Essential 3.1.1.8 (Build: 2016061717)  with Moodle 3.1.4+ (Build: 20170216).  I have a logo image that is 976px wide by 102px high.  The logo setting in Essential is 980px x 105px.

The problem is that the logo image is not responsive. When a mobile device is used the logo container seems to resize, but the image does not. Also no resizing takes place when I change my browser size.

I've searched for solutions and tried adding css code, but to no avail.  What am I missing?

Thanks,

Floyd

Average of ratings: -
In reply to Floyd Saner

Re: Essential - header logo image not responsive

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Floyd,

When the navbar is below the header and there is nothing bar the logo and possibly header background then there needs to be something to set the size of the containing area.  That is why there are height settings.  If the width was 100% (if made to work that way) then because the height is fixed then to keep the aspect ratio the width would be static.  Therefore the logo is not currently responsive.

You could consider using 'headerbackground' instead given the dimensions of your image.

I will be looking in the M3.2+ versions to use the compact logo setting whereby smaller images can be set for mobile devices.

I know this is not a solution and a better header needs to be developed like within the Campus theme.  Something for the future.

Kind regards,

Gareth

In reply to Gareth J Barnard

Re: Essential - header logo image not responsive

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Looking at compact logo etc. in M3.2 for the M3.2 version of the theme, then it and its bigger counter-part are not responsive.  So, as I've taken over Essential, can anybody remember if the logo was ever responsive in the themes history - if so, what version?

In reply to Gareth J Barnard

Re: Essential - header logo image not responsive

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

From memory, I think Julian used the same logo style that I originally added to Afterburner, which I made responsive in Moodle 2.6. It is the same basic style that got added to Clean and More themes up until the changes that were made in 3.0 or 3.1 whenever the context heading was introduced.

In reply to Mary Evans

Re: Essential - header logo image not responsive

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks Mary, I'll look back at how it was done and see if it can still be done now as even though an enhancement it feels to me like it should be responsive if it can be.

In reply to Gareth J Barnard

Re: Essential - header logo image not responsive

by Floyd Saner -

Thanks very much for the explanation, Gareth. At least I know there is a reason.

Regards,

Floyd

In reply to Floyd Saner

Re: Essential - header logo image not responsive

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Floyd,

There might be a solution in the M3.2 version (under development), which if works I might be willing to back-port.

Kind regards,

Gareth