Skip to content

v0.5.1

Choose a tag to compare

@karthikeyankc karthikeyankc released this 05 Jul 12:31
· 24 commits to main since this release
990455f

What's new

darkSelector option — pass any CSS selector to new DiscussWidget({ darkSelector: '...' }) and the widget applies its dark colour scheme when that selector matches an ancestor element.

new DiscussWidget({ darkSelector: 'html.dark' });

The widget has no default dark mode. It stays light unless you opt in, which means it no longer goes dark unexpectedly on sites that don't use dark mode.

Works with any class-based or attribute-based dark mode toggle — .dark, [data-theme="dark"], whatever your site uses.

Upgrading

Add darkSelector to your existing embed:

<link rel="stylesheet" href="https://your-server.com/client.css">
<div id="discuss-comments"></div>
<script src="https://your-server.com/client.js"></script>
<script>new DiscussWidget({ darkSelector: 'html.dark' });</script>

No database changes. No breaking changes for existing embeds — they just won't have dark mode until you add the option.