Is it possible to change the icon for staff notices?

We do not have a setting for that and I think doing it in CSS only is difficult, but you can create a theme component to replace it.

In CSS, you will hide the old icon:

.post-notice {
  .d-icon-user-shield {
    display: none;
  }
}

In JavaScript (you put this in <head> of the theme component), you will decorate the notice and add the new icon:

<script type="text/discourse-plugin" version="0.8">
  const { iconNode } = require("discourse-common/lib/icon-library");
  api.decorateWidget('post-notice:before', helper => {
    return iconNode('heart');
  });
</script>

… or if you want to replace with an image…:

<script type="text/discourse-plugin" version="0.8">
  api.decorateWidget('post-notice:before', helper => {
    return helper.h('img', {
      src: 'https://www.discourse.org/a/img/home-spot-1.png',
      style: 'margin-right: 0.65em',
      height: 30,
      width: 30
    });
  });
</script>

With themes and theme components, the sky is the limit. If you want to learn more, we have a resource for that:

12 Likes