#how to have different backgrounds on different pages

33 messages · Page 1 of 1 (latest)

high vigil
#

How do i makes it so that you could go on one page, and then another one, and they each have a different background that both have dark mode and light mode support?

winter schooner
#

A more general solution is to write some javascript. The user can specify a file on the page, and then the javascript will make that file the background image.

high vigil
winter schooner
#

It also only works for this particular skin. If you use a different skin, you will need to change the CSS.

high vigil
winter schooner
#

To have it work for dark mode would be a completely different story and one that requires considerable effort. I'm not sure if there is any shortcut.

high vigil
#

can i just make dark and light have the same bg?

winter schooner
#

Yes. It may only look good in one mode, though.

high vigil
winter schooner
#

My usual recommendation is that if you don't have a rough idea of how to do it yourself, don't do it. Fixing CSS when you don't know what you are doing will be a lot of pain. Look for a wiki that already has it implemented on Citizen and ask them instead.

high vigil
#

i guess im just rusty on miraheze itself lol

#

but thnx for the recommednation

high vigil
winter schooner
#

Preferably citizen.css so that it doesn't break other skins

high vigil
winter schooner
#

Just give it a try. I don't think you need special tweaks.

high vigil
high vigil
#

i'm pretty sure body.page-pagename doesnt work on citizen

winter schooner
high vigil
winter schooner
high vigil
winter schooner
#

You can find it with inspector. For example, on this page, the class name is page-Teatime_Delight.

high vigil
#

Oh it works! turns out my existing background code was overriding it xd

#

thank u!

high vigil
#

is there a way to do this for all pages in a category?

winter schooner
#

Javascript would be the way to go. I think someone mentioned something in #general ?

livid sage
#

Alternatively, you could also use a selector similar to this one (although this might be suboptimal for performance):

body:has(.catlinks a[title="Category:ExampleCategory"]) {
  background: url("<your background image url>");
}

(you'll need to update ExampleCategory to the name of the category, and the background URL to whatever background image you want to use)