1. #1
    Field Marshal
    10+ Year Old Account
    Join Date
    Apr 2012
    Location
    Minnesota
    Posts
    73

    spoiler tags not alterable

    I've been working on a dark theme for the website lately, and I was hoping to change the display for the spoiler tags, so the text would be more visible, on the new background I've been using. The problem I'm having right now is since the theme works with CSS, and the onclick spoiler tags seem to function off of javascript, I can't change the background on the text to match the actual text, without effectively ruining the onclick effect.

    Code:
    <span class="spoiler" style="color: black; cursor: pointer; background: none repeat scroll 0% 0% black;" onclick="if (this.style.backgroundColor != '') {this.style.background = '';} else {this.style.background = 'black';}"></span>

    What I would like to do is to turn the text white, however doing so makes it show up through the spoiler because the code restricts it to black instead of matching it with the default text color determined by CSS. I can make the whole thing work if I used :hover properties, but I would rather keep the spoilers onclick, and was hoping there was a way to get the javascript changed so that myself and anyone else that would like to work on a color theme for the sight would have the ability to work with the spoiler tags a little easier.
    MMO-Champion too bright for you? Give Dark Champion a try.

  2. #2
    Deleted
    Suggestion: Add the properties currently set in the style attribute to the CSS spoiler class.
    Code:
    <span class="spoiler" onclick="if (this.style.backgroundColor != ''){ this.style.background = '';} else {this.style.background = 'transparent';}"></span>

  3. #3
    Field Marshal
    10+ Year Old Account
    Join Date
    Apr 2012
    Location
    Minnesota
    Posts
    73
    I can't use any if/else statements in css. I'm attempting to workaround it with :focus properties but they only appear to work for a fraction of a second before it just works like normal.
    MMO-Champion too bright for you? Give Dark Champion a try.

  4. #4
    Deleted
    Recommendation not toward you, but toward any red who reads this (they probably already have).

  5. #5
    Miss Doctor Lady Bear Sunshine's Avatar
    15+ Year Old Account
    Join Date
    Mar 2009
    Location
    San Francisco
    Posts
    15,651
    The spoiler tag isn't nicely integrated because I had put it in as a hack myself without support from the devs at some point when we really wanted a spoiler tag.

    I'll see if we can get someone to put that part in via css; I'm not sure how busy they are right now though.

  6. #6
    Field Marshal
    10+ Year Old Account
    Join Date
    Apr 2012
    Location
    Minnesota
    Posts
    73
    Quote Originally Posted by Sunshine View Post
    The spoiler tag isn't nicely integrated because I had put it in as a hack myself without support from the devs at some point when we really wanted a spoiler tag.

    I'll see if we can get someone to put that part in via css; I'm not sure how busy they are right now though.
    Greatly appreciate it, want to make my theme as comprehensive as I can and that small bit of text was annoying the hell out of me.
    MMO-Champion too bright for you? Give Dark Champion a try.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •