No, you have to add these to the css sections.
So this will be all together.
Common / Header ![]()
<script type="text/discourse-plugin" version="0.8">
api.decorateWidget("post:after", helper => {
const firstPost = helper.attrs.firstPost;
const h = helper.h;
if (firstPost) {
return h("div#custom-ad", [
h(
"a.custom-ad-link",
{ href: "example.com" },
h("img", { src: "https://picsum.photos/id/74/750/90" })
)
]);
}
});
</script>
Common / CSS ![]()
#custom-ad {
.custom-ad-link {
img {
width: 100%;
}
}
}
Desktop / CSS ![]()
#custom-ad {
max-width: calc(45px + 690px + (11px * 2));
}


