'XML Code View' CSS is broken. Major pain to Elemental modders!

By on September 7, 2010 6:41:11 AM from Elemental Forums Elemental Forums

Das123

Join Date 05/2003
+79

The .alt css command in line 102 of style.css is over-riding the .codeblock li.alt command on line 24.

To give this (and the other .codeblock backgrounds) higher precedence you should add #aspnetForm in front.

Eg:

#aspnetForm .codeblock li.alt

As it stands right now the code blocks are illegible.

Locked Post 12 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 2:56:38 PM from Elemental Forums Elemental Forums

Hi again.

This can be solved in just a few minutes.

The XML display is seriously broken in the forums and the fix I mentioned above works (I tested it). Can someone please simply add #aspnetForm to the start of line 24 in the styles,css file?

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 3:48:48 PM from WinCustomize Forums WinCustomize Forums

What URL are you specifically having an issue with?  Depending on the site, the CSS changes drastically so unfortunately I am unable to help unless I know which site is the one with the problem.

Bara

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 3:57:53 PM from Elemental Forums Elemental Forums

Try testing from Elemental boards. Specifically, posting XML code from the game files does very funky things (every other line with black background).

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 6:10:59 PM from Elemental Forums Elemental Forums

Yes. It is the Elemental forum.

But all my suggested change does is force the code to give precedence to the id rather than the class.

Reason for Karma (Optional)
Successfully updated karma reason!
September 7, 2010 6:13:15 PM from Elemental Forums Elemental Forums
Reason for Karma (Optional)
Successfully updated karma reason!
September 8, 2010 6:23:20 AM from Elemental Forums Elemental Forums

Quoting GunslingerBara,
What URL are you specifically having an issue with?  Depending on the site, the CSS changes drastically so unfortunately I am unable to help unless I know which site is the one with the problem.

Bara

I had assumed that their was only a single stylesheet called 'style.css'. Now I can see you have a master stylesheet http://forums.elementalgame.com/css/Base/style.css

And a theme style sheet http://forums.elementalgame.com/Themes/Elemental%20v2/css/style.css

My earlier suggestion was to change the master stylesheet so I understand your reluctance.

However, there is an equally easy fix within the theme stylesheet.

The problem is that the class 'alt' is used both in the forum posting AND in the alternate rows of the code editor. The alt class in the forum is specified in the theme stylesheet while the alt class in the code view is specified in the master stylesheet.

The alt class in the forum (line 102) is always applied to a div so instead of:

Code: css
  1. .body .forum .post .replies .alt {background:none repeat scroll 0 0 #151510;}

if a div qualifier is added it corrects the problems:

Code: css
  1. .body .forum .post .replies div.alt {background:none repeat scroll 0 0 #151510;}

or you could use the 'reply' class instead of the div:

Code: css
  1. .body .forum .post .replies .reply.alt {background:none repeat scroll 0 0 #151510;}

Tested both of these and they work.

Reason for Karma (Optional)
Successfully updated karma reason!
September 8, 2010 7:33:47 AM from Elemental Forums Elemental Forums

Awesome, man! You've spread joy to modders everywhere who want to be able to add readable XML blocks in "reply" posts.
 

Gnilbert

Reason for Karma (Optional)
Successfully updated karma reason!
September 8, 2010 5:21:46 PM from Elemental Forums Elemental Forums

*Bump*

Please, with Elemental being soooooo XML heavy in modding this is really important. Particularly as modding will be focussed on more heavily in the very near future. It is such an easy fix as well.

If this is a problem is there any way we can put our own style tags in the editor to over-ride the formatting? I tried this but it didn't stick.

Reason for Karma (Optional)
Successfully updated karma reason!
September 12, 2010 3:19:28 PM from Elemental Forums Elemental Forums

If modders using the Elemental forums want to fix this I found a reasonably simple work-around through a Firefox plugin.

Details are here:

http://forums.elementalgame.com/396187


BTW, Bara or whoever else will fix this, the default font colour also needs to be corrected as well. I see that the style sheet was worked on recently so the old line numbers are a little out.

Suggest now adding the .codeblock overrides back in to the Theme style.css as a new entry because of the font colour change.

Code: css
  1. #aspnetForm .codeblock li {
  2. color:#000;
  3. }
  4. #aspnetForm .codeblock li.alt {
  5. background:none repeat scroll 0 0 #F8F8F8;
  6. }

Just adding the 'aspnetForm' id to the .codeblock class gives it precedence.

Reason for Karma (Optional)
Successfully updated karma reason!
September 13, 2010 11:56:36 AM from Elemental Forums Elemental Forums

I've fixed the alternate background and changed the text color to black.  However, I've kept the alternate background to a light grey to help differentiate between multiple-line XML and single-line XML.

Note that it may require a hard refresh (Ctrl + F5) for the CSS to update.

Bara

Reason for Karma (Optional)
Successfully updated karma reason!
September 13, 2010 1:41:16 PM from Elemental Forums Elemental Forums

Awesome news! 

One less thing for Das123 to complain about. (J/K)

Reason for Karma (Optional)
Successfully updated karma reason!
September 13, 2010 3:02:15 PM from Elemental Forums Elemental Forums

Quoting Gravedancer,
One less thing for Das123 to complain about. (J/K)

Lol  

Thanks Bara. Working great.

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #101114  walnut1   Server Load Time: 00:00:00.0001437   Page Render Time: