ElkArte Community

Elk Development => Theme development => Topic started by: Genesis on September 25, 2016, 05:41:21 pm

Title: Set different log ofor mobile version?
Post by: Genesis on September 25, 2016, 05:41:21 pm
My logo was made for desktop users, but now its far too big on mobile and i was wondering if i could set a diffent logo for the mobile version of the site?

Even if it was smaller it would be hard to read on mobile anyways, so I'm kind of stuck.
Title: Re: Set different log ofor mobile version?
Post by: radu81 on September 25, 2016, 07:16:23 pm
You can resize the logo to fit the width of your screen or a percentage you decide.  Post a link to your forum 
Title: Re: Set different log ofor mobile version?
Post by: ahrasis on September 25, 2016, 09:41:05 pm
Quote from: Genesis – My logo was made for desktop users, but now its far too big on mobile and i was wondering if i could set a diffent logo for the mobile version of the site?

I think this is possible by loading your image from css in #logobox using ::before while displaying none for #logo.
Title: Re: Set different log ofor mobile version?
Post by: emanuele on September 26, 2016, 07:48:51 am
Usually yes, it also depends how the logo was set to begin with (admin panel, replacing files, changing theme, etc.).
Title: Re: Set different log ofor mobile version?
Post by: ahrasis on September 26, 2016, 08:54:34 am
I thought mobile png is for favicon or something, but may be I was wrong.

Quote from: Genesis – Even if it was smaller it would be hard to read on mobile anyways, so I'm kind of stuck.
I think resize is not an option too.

I'd agree that the use of css will depend on how logo is set. My suggestion is based on default setup. It can be improvised.
Title: Re: Set different log ofor mobile version?
Post by: radu81 on September 26, 2016, 09:19:37 am
Quote from: ahrasis – I thought mobile png is for favicon or something, but may be I was wrong.
It is for favicon, not for logo on mobile
http://www.elkarte.net/community/index.php?topic=1847.0
Title: Re: Set different log ofor mobile version?
Post by: emanuele on September 26, 2016, 03:29:40 pm
You can (still) replace the logo with some css, "just" set a different logo in the appropriate media query, one that works for mobile.
Something like...
Code: [Select]
@media screen and (max-width: 33.750em) {
#logobox img { display:none;} /* removes the normal background */
#logobox:before { display:block; width: 100%; max-width: none; /* makes the logo as wide as possible */
height: 50px; /* the height that you prefer */
background-image:url(http://www.elkarte.net/community/themes/testing_theme_1-1/images/_light/logo_elk.png); /* the url to the image */
}
}
Title: Re: Set different log ofor mobile version?
Post by: Genesis on September 27, 2016, 12:26:30 am
Thank you for your help! I'll try this. :)