From 196f71feb702212e8951a8b8c4515d33192c25ab Mon Sep 17 00:00:00 2001 From: Jamie Barton Date: Thu, 8 Nov 2018 13:42:55 +0000 Subject: [PATCH] Refactor with tailwindcss example to use next-css (#5461) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of bundling `postcss-cli` we can now make use of `@zeit/with-css`. This also means we can get rid of the ` -) - -export default Nav +} diff --git a/examples/with-tailwindcss/next.config.js b/examples/with-tailwindcss/next.config.js new file mode 100644 index 00000000..00a78beb --- /dev/null +++ b/examples/with-tailwindcss/next.config.js @@ -0,0 +1,3 @@ +const withCSS = require('@zeit/next-css') + +module.exports = withCSS({}) diff --git a/examples/with-tailwindcss/package.json b/examples/with-tailwindcss/package.json index 83b39ca5..a0f92be5 100644 --- a/examples/with-tailwindcss/package.json +++ b/examples/with-tailwindcss/package.json @@ -2,13 +2,12 @@ "name": "with-tailwindcss", "version": "1.0.0", "scripts": { - "dev": "next & yarn dev:css", - "dev:css": "postcss styles/index.css --watch -c styles/config/postcss.config.js -o static/css/bundle.css", - "build": "next build & yarn build:css", - "build:css": "postcss styles/index.css -c styles/config/postcss.config.js -o static/css/bundle.css", + "dev": "next", + "build": "next build", "start": "next start" }, "dependencies": { + "@zeit/next-css": "^1.0.1", "next": "latest", "react": "^16.0.0", "react-dom": "^16.0.0" @@ -16,8 +15,7 @@ "devDependencies": { "autoprefixer": "^7.1.6", "cssnano": "^3.10.0", - "postcss-cli": "^4.1.1", "postcss-easy-import": "^3.0.0", - "tailwindcss": "^0.2.2" + "tailwindcss": "^0.6.6" } } diff --git a/examples/with-tailwindcss/pages/_app.js b/examples/with-tailwindcss/pages/_app.js new file mode 100644 index 00000000..d6493e19 --- /dev/null +++ b/examples/with-tailwindcss/pages/_app.js @@ -0,0 +1,16 @@ +import '../styles/index.css' + +import React from 'react' +import App, { Container } from 'next/app' + +export default class MyApp extends App { + render () { + const { Component, pageProps } = this.props + + return ( + + + + ) + } +} diff --git a/examples/with-tailwindcss/pages/_document.js b/examples/with-tailwindcss/pages/_document.js deleted file mode 100644 index 1e4fa180..00000000 --- a/examples/with-tailwindcss/pages/_document.js +++ /dev/null @@ -1,26 +0,0 @@ -import Document, { Head, Main, NextScript } from 'next/document' - -class MyDocument extends Document { - static getInitialProps ({ renderPage }) { - const { html, head, errorHtml, chunks } = renderPage() - - return { html, head, errorHtml, chunks } - } - - render () { - return ( - - - - - - {this.props.customValue} -
- - - - ) - } -} - -export default MyDocument diff --git a/examples/with-tailwindcss/pages/index.js b/examples/with-tailwindcss/pages/index.js index 2540b352..cbda7621 100644 --- a/examples/with-tailwindcss/pages/index.js +++ b/examples/with-tailwindcss/pages/index.js @@ -1,9 +1,7 @@ -import Head from '../components/head' import Nav from '../components/nav' export default () => (
-