ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: Antechinus on June 10, 2013, 10:22:49 am

Title: Theme width & variant css - eh?
Post by: Antechinus on June 10, 2013, 10:22:49 am
Ok, this is a good one. Just messing around with variants a bit more, and something odd has happened.

Forum width on the current theme page is set to 85%.

Wrapper width in the index.css file is set to 95%.

When theme is on default variant (ie: running straight from index.css) the 85% setting from admin works.

When theme is on a variant.css file, the setting from admin doesn't work, and the theme falls back to the 95% in the css file.

Figure that one out. :D
Title: Re: Theme width & variant css - eh?
Post by: Arantor on June 10, 2013, 10:55:34 am
Pfft, I haven't even seen the code but I can tell you why that happens. Give me a hard one next time :P

The master index.css is loaded first. Then the width if set in the admin panel is declared as a <style> in the <head>, so it overrides the index.css. Then a variant, if set, is loaded. If the variant happens to set the width, it's going to override both the index.css and the admin set one.

Easiest fix is to move the admin width after both the main and variant declarations so the admin setting overrides both.
Title: Re: Theme width & variant css - eh?
Post by: emanuele on June 10, 2013, 11:27:47 am
Here it is:
https://github.com/elkarte/Elkarte/pull/510

In fact there were a couple of bugs around... :P
Title: Re: Theme width & variant css - eh?
Post by: Antechinus on June 10, 2013, 05:25:53 pm
Ah. Well it was midnight. :P

Anyway, thinking about it some more, this could either be a bug or desirable behaviour, depending on what you want to do with the variant.
Title: Re: Theme width & variant css - eh?
Post by: Antechinus on June 11, 2013, 07:15:00 pm
After thinking somemore, I've decided this is desirable behaviour. :D If peeps don't want the variant changing forum width, they don't set any width in the variant file. Easy. If they do want full width and fixed width variants, they can do it.

Close bug report. All stomped innit. :P
Title: Re: Theme width & variant css - eh?
Post by: emanuele on June 15, 2013, 08:51:39 am
Well, it was already "fixed", so the new behaviour is the correct one. :P