# Trying to show self replies in color

**URL:** <https://meta.discourse.org/t/trying-to-show-self-replies-in-color/122410>\
**Category:** Feature\
**Created:** [7월 9, 2019, 6:42오전 UTC](https://meta.discourse.org/t/trying-to-show-self-replies-in-color/122410 "2019-07-09T06:42:32Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)\
**Post date:** [7월 9, 2019, 1:54오후 UTC](https://meta.discourse.org/t/trying-to-show-self-replies-in-color/122410/4 "2019-07-09T13:54:02Z")

</div>

You can do this by adding the following code to the Header of your theme (or to the header of a theme component):

```js
<script type="text/discourse-plugin" version="0.8">
    const currentUser = api.getCurrentUser();
    api.addPostClassesCallback((attrs) => {
        if (currentUser && currentUser.id === attrs.user_id) {
            return ["post-by-current-user"];
        } else {
            return [];
        }
    });
</script>

```

You can then use the `post-by-current-user` class in your stylesheet.

---

_[View the full topic](https://meta.discourse.org/t/trying-to-show-self-replies-in-color/122410)._
