There’s an unofficial theme component for this. I tried it and it works on last Discourse version (3.1.0.beta4).