Rendering a chat thread in CSS and JavaScript 0 ▲ alexwlchan 183 days ago · 8 min read1670 words · Tech · hide · Fediverse post · 1 reply The first iteration of my scrapbook of social media only had posts from public or semi-public social media sites – Twitter, Instagram, Tumblr, and so on. Every post is saved as JSON metadata, and rendered as HTML in my web browser. For a while now, I’ve wanted to add support for text conversations. I don’t care about saving my texts en masse, but there are moments which stand out and which I’d like to save. I thought this would be quite straightforward, but I ran into trouble rendering chat bubbles in CSS. I got it working once I walked through it carefully, and I wanted to explain how it works – so I understand it now, and so I remember it later. Let’s start with some semantic HTML which represents a group chat with three participants, based on characters from Terry Pratchett’s Monstrous Regiment: <div class="conversation"> <div class="message-group" data-sender="Wazzer"> <blockquote>The Duchess says your path takes you further</blockquote> <cite>Wazzer</cite> </div> <div… Replies Rendering a chat thread in CSSx-log · 181 days ago · details