script#utterances_comment(src=theme.CDN.utterances repo=theme.utterances.repo issue-term=theme.utterances.issue_term theme= theme.display_mode === 'dark' ? theme.utterances.dark_theme : theme.utterances.light_theme crossorigin="anonymous" async) if theme.darkmode.enable script. var themeNow = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}' document.getElementById('utterances_comment').setAttribute('theme',themeNow) function utterancesTheme () { var theme = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}' const message = { type: 'set-theme', theme: theme }; const iframe = document.querySelector('.utterances-frame'); iframe.contentWindow.postMessage(message, 'https://utteranc.es'); }