Comment Author Coloring

I am trying to color the comments by the post author to be more visible

.comment {
    background: rgba(56, 56, 56, 0.2) !important;
}

.bypostauthor {
    background: rgba(64, 64, 64, 0.2) !important;
}

.bypostauthor .x-comment-author a, .bypostauthor .x-comment-author {
    color: rgb(176, 32, 32) !important;
}

It does change the color of the post author, but at the same time also of the ones that answer in the thread behind, and seems to stack. “myrddin” is the comment author.

if anyone has the correct css I would be grateful

Hey there,

Try removing , .bypostauthor .x-comment-author from

.bypostauthor .x-comment-author a, .bypostauthor .x-comment-author {
    color: rgb(176, 32, 32) !important;
}

Thanks.

I am unable to edit the topic, but as the text above says, I do not want “all authors” to be red, just want to add a slight highlight to the postauthor… my previous theme colored the author automatically and wanted to add the same to X Theme.

You wanted me to change:

.bypostauthor .x-comment-author a, .bypostauthor .x-comment-author {
    color: rgb(176, 32, 32) !important;
}

by removing .bypostauthor .x-comment-author to

.bypostauthor .x-comment-author a {
    color: rgb(176, 32, 32) !important;
}

It did not work. Again… my css works for simple comments, but every following comment in the thread will gain the same attributes, if another post author comment appears the bg-highlight will be stronger…

Comment Author Names are most of the time not “linked”, they are simple texts…

I simply want to highlight the post author name and the background of his comment

Hi There,

Please try using this custom CSS instead:

  .byuser.bypostauthor>.comment .x-comment-author {
      color: rgb(176,32,32);
      background: white;
      padding: 2px 5px;
      margin-top: 5px;
      display: inline-block;
   }

Adjust the values accordingly. Result will be this: https://screencast-o-matic.com/watch/cbioiJl0nM

Hope this helps.

1 Like

Awesome this worked. I tried countless variants before, but never the .byuser.bypostauthor

This is the code that worked for me.

.byuser.bypostauthor>.comment {
    background: rgba(160, 160, 192, 0.1) !important;
}
.byuser.bypostauthor>.comment .x-comment-author {
    color: rgb(176, 32, 32);
}

Glad we were able to help :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.