Skip to main content
Topic: Theme width & variant css - eh? (Read 6268 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Theme width & variant css - eh?

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
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Theme width & variant css - eh?

Reply #1

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.

Re: Theme width & variant css - eh?

Reply #2

Here it is:
https://github.com/elkarte/Elkarte/pull/510

In fact there were a couple of bugs around... :P
Bugs creator.
Features destroyer.
Template killer.

Re: Theme width & variant css - eh?

Reply #3

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.
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Theme width & variant css - eh?

Reply #4

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
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Theme width & variant css - eh?

Reply #5

Well, it was already "fixed", so the new behaviour is the correct one. :P
Bugs creator.
Features destroyer.
Template killer.