Hristo

  • Posts: 19
Body tag classes
« on March 29th, 2013, 06:06 PM »
Imho, it would be useful if you add some body tag classes/ID which would ease targeting categories/boards/(type of) message(s) ect.

SMF 2.1 has browser ID, action and board number classes.
XenForo has category number and board number classes.

Since on practice there is no limit for the attribute's value length there should be no problem to add even more classes, like 'sticky', 'thread_number', 'locked' ect. Obviously the main purpose for this is to further ease the theming.

Just my $0.02

Nao

  • Dadman with a boy
  • Posts: 16,068
Re: Body tag classes
« Reply #1, on March 29th, 2013, 06:17 PM »
Ah... The joys of Wess... :whistle:

- Browser ID:

@if (opera[12.1-] && !windows)
  .my_class
    display: none
@endif

- action: nothing in Wess, because we already have that, right below the #content div. (And I'm not recompiling a CSS file for every page... :lol:)

<div id="content"><div class="frame" id="pm">

- board number:

Have a file called 'extra.b1,b2,b3.css' with your hacks. It will be applied to boards 1 to 3. (Technically, I *could* add a similar feature for actions... But I'm trying to get away from my suffix system, and emphasize the practical side of @if tests right within CSS files.)

- category:

Same, extra.c1,c2,c3.css

- I'll add the all-important one: @if member / @if guest is very useful on a daily basis.

So, I guess... The answer is... No need for that..?

Hristo

  • Posts: 19
Re: Body tag classes
« Reply #2, on March 29th, 2013, 06:40 PM »
One more thing to learn when time comes :)

Nao

  • Dadman with a boy
  • Posts: 16,068
Re: Body tag classes
« Reply #3, on March 29th, 2013, 08:34 PM »
Well, I don't know, I've been thinking about all of this, and maybe, MAYBE it would be best to get rid of b1/c1 suffixes and instead add them to the body or another tag... I don't know, I just don't. These have been bugging me for a while.