Make generated iframe embed code work well with transparent background (#5672)

* Explicitly declare color scheme availability and preference

* Revert "Explicitly declare color scheme availability and preference"

This reverts commit e1e6242d29.

* Add `color-scheme: auto;` to generated iframe embed code
This commit is contained in:
Adrian Gruntkowski 2025-08-27 13:36:05 +02:00 committed by GitHub
parent c3af79a115
commit 54641ccea6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -115,7 +115,7 @@ if (embedButton) {
embedLink.searchParams.set('background', background)
}
embedCode.value = `<iframe plausible-embed src="${embedLink.toString()}" scrolling="no" frameborder="0" loading="lazy" style="width: 1px; min-width: 100%; height: 1600px;"></iframe>
embedCode.value = `<iframe plausible-embed src="${embedLink.toString()}" scrolling="no" frameborder="0" loading="lazy" style="width: 1px; min-width: 100%; height: 1600px; color-scheme: auto;"></iframe>
<div style="font-size: 14px; padding-bottom: 14px;">Stats powered by <a target="_blank" style="color: #4F46E5; text-decoration: underline;" href="https://plausible.io">Plausible Analytics</a></div>
<script async src="${baseUrl}/js/embed.host.js"></script>`
} catch (e) {