Conversation
Notices
-
heeeheee I found a logical bug in Wordpress. threaded comments are generated as nested lists; comments by postauthor get an extra class - which can be used for styling; now, when a comment is replied to by postauthor and that in turn by another user, that last comment *inherits* the 'bypostauthor' class - and styling gets a confused mess :D I can either write an override for the function that creates the classes and add a 'notpostauthor' class, or write much more specific (and complicated and fragile) CSS... #wordpress #css
-
@mk to work around it in CSS only, I will have to resort to the CSS3 :not() selector (which IE8 does not support - that won't break anything functional, but display won't be optimal). Hmm. #wordpress #css
-
@mk I think the idea is that replies to !Wordpress postauthor comments are children of that comment, so that replies are styled similarly but nested one list item deeper
-
@bobjonkman yes - that's one school of thought, but I don't subscribe to that idea. And nested comments lead to all sorts of styling problems. You can also put replies *below* the comment it replies to, and give it an indent that represents the level. That results in a clean HTML structure and is much easier to style.
-
@bobjonkman This problem of styling caused by nesting is by no means specific to Wordpress; another aproach would be to nest, but give those comments by NOT the post author their own class. Even then styling is hard because of the nesting.
-
@bobjonkman well, I finally got it working but that was *quite* involved; *I* was loading the parent stylesheet and it's 'dark' stylesheet, followed by my own child-theme stylesheet (I actually got that right) - but WP was then loading the 'dark' stylesheet *again* outside my control - and (apparently because that was not 'enqueued' I could not remove it either. I had to fiddle with priorities it get the "extra" 'dark' stylesheet first, followed by parent stylsheet, dark, and my child-theme stylesheet - so 'dark' was no longer overriding mine. And then I had to use quite precide selectors (including :not()) to select either a comment by postauthor (class) or a comment by someone else (no class) to give them different styling... #phew More tweaks to do, but I'll have to write this one down!
-
@bobjonkman oh, and I had to actually remove one rule from 'dark' because it was interfering anyway (matching both postauthor and others, and stopping there). Doing that is a no-no, but it was the only way...