Thanks for your reply!
I’m not sure how to install the theme but I managed to patch your original component like so:
<script type="text/discourse-plugin" version="0.8">
const container = Discourse.__container__;
this.capabilities = container.lookup("capabilities:main");
if (this.capabilities.touch) {
withPluginApi("0.8", api => {
api.onToolbarCreate(toolbar => {
toolbar.addButton({
id: "code",
group: "insertions",
icon: "code",
preventFocus: true,
trimLeading: true,
action: "formatCode",
});
});
});
}
</script>
The CSS remains the same.