Add Template / Page / Location CSS Classes to html <body> element | World Anvil

Remove these ads. Join the Worldbuilders Guild

Add Template / Page / Location CSS Classes to html <body> element

New Feature Addition · Articles & templates · Created by Buzzard
accepted

What functionality is missing? What is unsatisfying with the current situation?

At present, template-specific and page-specific CSS classes are only added to the <div> elements with "user-css" and "user-css-extended" classes. So it is not possible to make template-specific CSS customizations to elements within the "user-css-presentation" class.  

How does this feature request address the current situation?

Adding these template and page-specific classes (IE "template-vehicle", "page-world-homepage", etc.) to the <body> tag with the "user-css-presentation" class would provide new avenues of CSS customizations.   Having these CSS classes on the body tag would make it possible to do things like:  
  • Have different page background images for an individual template or the world's home page.
  • Customize the World Navigation Palette on the home page without changing it on article pages.
  • Customize more page features based on the template-type.
  There are many ways this change could be used to create more dynamic and interesting themes and CSS customizations.
Current score

21/300 Votes · +6000 points

Votes Cast

  • +200

    by kaibrightwing
    on 2022-05-04 19:07
  • +100

    by SpencerH23
    on 2022-05-02 16:55
  • +200

    by scholarmage
    on 2022-05-02 15:31
    While it would be a chunky project to make the CSS labelling unique to templates, I think it would be a great value-add, for example to allow users to have distinct styling for location pages vs character pages.
  • +300

    by Ononomad
    on 2022-04-30 12:54
  • +300

    by A Sneaky Mlem
    on 2022-04-29 06:57
  • +300

    by Hanhula
    on 2022-04-27 23:12
  • +300

    by PantSeatPilot
    on 2022-04-27 19:12
    Please do this! I'll email you a cookie if you do!!
  • +300

    by JohanWq
    on 2022-04-25 07:14
  • +200

    by catlandia
    on 2022-04-24 12:50
  • +300

    by The Speaker
    on 2022-04-20 17:49
  • +200

    by LeighThalion
    on 2022-04-18 13:08
  • +300

    by ddaniel
    on 2022-04-17 18:32
  • +300

    by Dalf32
    on 2022-04-17 07:39
  • +300

    by MalevolentAura
    on 2022-04-16 19:22
    Absolutely love it!
  • +300

    by Satrium
    on 2022-04-15 12:29
  • +300

    by lengna
    on 2022-04-15 12:21
  • +300

    by Kummer Wolfe
    on 2022-04-15 10:54
    That would help with what I do for session report restyling! Yes!
  • +300

    by denversg1
    on 2022-04-15 10:01
    Yes please
  • +300

    by EmilyArmstrong
    on 2022-04-15 02:37
  • +300

    by Graylion
    on 2022-04-15 00:42
  • +300

    by spartango
    on 2022-04-15 00:42
  • +300

    by Buzzard
    on 2022-04-15 00:39