title: Is it possible to get access to document object in Nuxt.js middleware?
body: <p>I have created middleware that should be used to check what colour theme of website user has and set it. Here is how it looks like:</p>
  <pre class="lang-js prettyprint-override"><code>export default function({ store }) {
    if (process.client) {
      document.documentElement.setAttribute('data-theme', store.getters['theme/dark'] ? 'dark' : 'light')
    }
  }
  </code></pre>
  <p>You can see <code>if</code> condition that is used to make it work only on client side, but, actually, I want to make this middleware to set this value on server side.</p>
  <p>It works fine, but only when I visit page by clicking <code>nuxt-link</code>, not on page load, and because of this, page's styles seem to be broken.</p>
  <p>Is this possible to get access to <code>document</code> object in <code>Nuxt</code> middleware?</p>