Some checks failed
Deploy Eventually (In)Consistent / build-and-deploy (push) Has been cancelled
24 lines
804 B
HTML
24 lines
804 B
HTML
<script defer src="https://comentario.cotti.com.br/comentario.js"></script>
|
|
<comentario-comments></comentario-comments>
|
|
<noscript>Please enable JavaScript to view comments.</noscript>
|
|
|
|
<script>
|
|
function detectTheme() {
|
|
const storedTheme = localStorage.getItem("theme");
|
|
if (storedTheme === "dark" || storedTheme === "light") {
|
|
return storedTheme;
|
|
}
|
|
|
|
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
|
return "dark";
|
|
}
|
|
|
|
return "light";
|
|
}
|
|
|
|
const comentarioComments = document.getElementsByTagName("comentario-comments");
|
|
const theme = detectTheme();
|
|
for (const commentElement of comentarioComments) {
|
|
commentElement.setAttribute("theme", theme);
|
|
}
|
|
</script>
|