javascriptembedoembedmastodon

Mastodon Post [toot] Embed - Change to Light Theme


Mastodon offers an embed option for individual posts/toots by adding /embed at the end of the post URL. However, it seems that Mastodon always defaults to a dark theme. For example:

https://mstdn.social/@eladratson/109366816613595747/embed

enter image description here

I'm looking for a way to generate an embed URL that will render the same post but with Mastodon's light theme.

I've tried using theme= as a query option in the URL like this:

https://mstdn.social/@eladratson/109366816613595747/embed?theme=mastodon_light or mstdn_light

but it doesn't work. Anyone knows how could this be achieved?


Solution

  • There does not appear to be an option to do this in the default Mastodon embed options. They use an iframe, which then pulls in CSS from the Mastodon CDN, and the only styles defined there are the default darker Mastodon colour.

    You could use the API to grab the content directly, and style it yourself.