# CSS tweak for bigger avatar icons in polls?

**URL:** https://meta.discourse.org/t/css-tweak-for-bigger-avatar-icons-in-polls/115575
**Category:** Support
**Created:** [April 21, 2019, 6:58am UTC](https://meta.discourse.org/t/css-tweak-for-bigger-avatar-icons-in-polls/115575 "2019-04-21T06:58:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Cozdabuch](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cozdabuch/32/139120_2.png) [@Cozdabuch](https://meta.discourse.org/u/Cozdabuch)
#### Post date: [April 21, 2019, 6:58am UTC](https://meta.discourse.org/t/css-tweak-for-bigger-avatar-icons-in-polls/115575/1 "2019-04-21T06:58:37Z")

</div>

Can anyone identify a quick CSS tweak to make the user thumbnails within polls display a different size (say 2x for example sake)?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [April 22, 2019, 4:56pm UTC](https://meta.discourse.org/t/css-tweak-for-bigger-avatar-icons-in-polls/115575/2 "2019-04-22T16:56:07Z")

</div>

You don’t want to do this with CSS because the avatars are only 20x20px, so increasing the size will make them noticeably blurry.

You’d instead want to reopen the widget and request a larger avatar size… You can add this to your theme’s `/head` file. This overrides the existing widget and requests a large avatar instead of a tiny one.

```plaintext
<script type="text/discourse-plugin" version="0.8.13">
const { h } = require('virtual-dom');
const { avatarFor } = require('discourse/widgets/post');

api.reopenWidget("discourse-poll-voters", {
  html(attrs, state) {
    if (attrs.voters && state.loaded === "new") {
      state.voters = attrs.voters;
    }

    const contents = state.voters.map(user => {
      return h("li", [
        avatarFor("large", {
          username: user.username,
          template: user.avatar_template
        }),
        " "
      ]);
    });

    if (state.voters.length < attrs.totalVotes) {
      contents.push(this.attach("discourse-poll-load-more", attrs));
    }

    return h("div.poll-voters", contents);
  }
});
</script>

```

Then you’d have a 45px avatar to work with, and if you optionally wanted to adjust the size a little more with CSS:

```css
.poll-voters-list {
  img.avatar {
    width: 40px;
    height: 40px;
  }
}

```

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 22, 2019, 4:58pm UTC](https://meta.discourse.org/t/css-tweak-for-bigger-avatar-icons-in-polls/115575/3 "2019-05-22T16:58:44Z")

</div>

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