No highlighting of unread post a CSS problem

No highlighting of unread post a CSS problem

by Eric Straw -
Number of replies: 2
Here is the condensed version: If you want unread post highlighting to work then you need to ensure you have the ".unread" class specified.

I just posted over on tracker
http://tracker.moodle.org/browse/MDL-18971

I have cross-posted this to the Themes forum as well.

The styles_color.css includes the ".unread" class in the core section. Unfortunately, a number of the Moodle supplied themes do not include the ".unread" class. This results in unread posts failing to be highlighted in various themes that do not include the styles_color.css or a specific ".unread" class (examples include formal_white, chameleon, etc.).

The forum section of styles_color.css has a number of combined classes where the first class is never defined.

Example:
.forumthread .unread {
background: #FFD991;
}

Combining two classes together (e.g. as done above with .forumthread .unread) adds nothing to the style (i.e. the "background: #FFD991;" is ignored). Combining two classes together is done because you want the style from both to be applied. There is no need to specify a combined class in a CSS unless you desire it for a placeholder.

If you want unread post highlighting to work then you need to ensure you have the ".unread" class specified. The rest is somewhat academic. For the CSS to be correct in the forum section of styles_color.css all of the classes need to be specified before they are combined with other classes (e.g. ".forumpost" and ".forumthread").

I am including a test file that illustrates behavior from combining classes in case anyone wants to experiment with the underlying problem identified here.
Average of ratings: Useful (2)
In reply to Eric Straw

Re: No highlighting of unread post a CSS problem

by Sya Rahim -

Dear Eric

Thank you so much. Your explanation really helps. Appreciate it.