Permalink
    
      
  
      
    
      
          
            
            
              
            
            
                
                  
                
                  
            
          
          
          
          
          
          
          
          
            
            
            
                
                  
                
                  
                
                  
                
                  
                
                  
            
          
          
          
          
          
          
          
          
            
            
            
                
                  
                
                  
                
                  
                
                  
            
          
          
            
            
              
            
            
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
            
          
          
          
            
            
              
            
            
                
                  
                
                  
                
                  
                
                  
            
          
          
          
          
            
            
            
                
                  
                
                  
                
                  
                
                  
                
                  
            
          
          
          
            
            
            
                
                  
            
          
          
            
            
            
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
            
          
          
          
          
          
          
          
            
            
            
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
            
          
          
          
          
          
          
            
            
              
            
            
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
                  
                
            
          
          
            
            
            
                
                  
                
                  
            
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
            
            
              
            
            
                
                  
                
                  
                
                  
                
                  
            
          
          
          
      
    
  
  
  Newer
  
  
        
          
        
        100644
        
          138 lines (129 sloc)
          
        4.67 KB
      
    1
                  import React from 'react';
                2
                  import Document, { Head, Main, NextScript } from 'next/document';
                11
                  // You can find a benchmark of the available CSS minifiers under
                12
                  // https://github.com/GoalSmashers/css-minification-benchmark
                13
                  // We have found that clean-css is faster than cssnano but the output is larger.
                14
                  // Waiting for https://github.com/cssinjs/jss/issues/279
                15
                  // 4% slower but 12% smaller output than doing it in a single step.
                27
                            <meta
                28
                              name="description"
                29
                              content="React Components that Implement Google's Material Design."
                30
                            />
                31
                            {/* Use minimum-scale=1 to enable GPU rasterization */}
                32
                            <meta
                33
                              name="viewport"
                34
                              content={
                35
                                'user-scalable=0, initial-scale=1, ' +
                36
                                'minimum-scale=1, width=device-width, height=device-height'
                37
                              }
                38
                            />
                39
                            {/*
                40
                              manifest.json provides metadata used when your web app is added to the
                41
                              homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
                42
                            */}
                43
                            <link rel="manifest" href="/static/manifest.json" />
                44
                            {/* PWA primary color */}
                46
                            <link
                47
                              rel="stylesheet"
                48
                              href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"
                49
                            />
                53
                            <meta name="twitter:site" content="@MaterialUI" />
                54
                            <meta name="twitter:title" content="Material-UI" />
                55
                            <meta
                56
                              name="twitter:description"
                57
                              content="React Components that Implement Google's Material Design."
                59
                            <meta name="twitter:image" content="https://material-ui-next.com/static/brand.png" />
                60
                            {/* Facebook */}
                61
                            <meta property="og:type" content="website" />
                62
                            <meta property="og:title" content="Material-UI" />
                63
                            <meta
                64
                              property="og:description"
                65
                              content="React Components that Implement Google's Material Design."
                66
                            />
                74
                            {/* Global Site Tag (gtag.js) - Google Analytics */}
                75
                            <script async src={`https://www.googletagmanager.com/gtag/js?id=${config.google.id}`} />
                76
                            <script
                77
                              // eslint-disable-next-line react/no-danger
                78
                              dangerouslySetInnerHTML={{
                79
                                __html: `
                80
                  window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments)};
                81
                  gtag('js', new Date());
                82
                                `,
                83
                              }}
                84
                            />
                94
                    // Resolution order
                95
                    //
                96
                    // On the server:
                97
                    // 1. page.getInitialProps
                98
                    // 2. document.getInitialProps
                99
                    // 3. page.render
                100
                    // 4. document.render
                101
                    //
                102
                    // On the server with error:
                103
                    // 2. document.getInitialProps
                104
                    // 3. page.render
                105
                    // 4. document.render
                106
                    //
                107
                    // On the client
                108
                    // 1. page.getInitialProps
                109
                    // 3. page.render
                110
                  111
                    // Get the context of the page to collected side effects.
                112
                    const pageContext = getPageContext();
                128
                      styles: (
                129
                        <style
                130
                          id="jss-server-side"
                131
                          // eslint-disable-next-line react/no-danger