# app/shared/ThemeToggle/index.coffee document.head.insertAdjacentHTML('beforeend','') module.exports = name: 'ThemeToggle' render: (new Function '_ctx', '_cache', renderFns['app/shared/ThemeToggle/index.pug'])() data: -> theme: 'light' beforeUnmount: -> debug.log "slider start" mounted: -> @theme = localStorage.theme || 'light' methods: toggleTheme: -> @theme = if @theme == 'light' then 'dark' else 'light' localStorage.setItem 'theme', @theme document.documentElement.classList.toggle 'dark' @$emit 'theme-changed', @theme