├── .prettierrc ├── public └── favicon.ico ├── styles.css ├── pages ├── _app.js └── index.js ├── README.md ├── .gitignore ├── postcss.config.js ├── package.json ├── LICENSE └── components └── nav.js /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/statickit-projects/next-js-tailwind/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /styles.css: -------------------------------------------------------------------------------- 1 | /* purgecss start ignore */ 2 | @tailwind base; 3 | @tailwind components; 4 | /* purgecss end ignore */ 5 | 6 | @tailwind utilities; 7 | -------------------------------------------------------------------------------- /pages/_app.js: -------------------------------------------------------------------------------- 1 | import '../styles.css'; 2 | 3 | function App({ Component, pageProps }) { 4 | return ; 5 | } 6 | 7 | export default App; 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Next.js + Tailwind Starter Project 2 | 3 | A bare Next.js project with Tailwind CSS installed. 4 | 5 | [**Check out the guide →**](https://statickit.com/guides/next-js-tailwind) 6 | 7 | ## Usage 8 | 9 | To run this code: 10 | 11 | ``` 12 | git clone https://github.com/unstacked/next-js-tailwind.git 13 | cd next-js-tailwind 14 | npm install 15 | npm run dev 16 | ``` 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | .env* 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | ...(process.env.NODE_ENV === 'production' 6 | ? { 7 | '@fullhuman/postcss-purgecss': { 8 | content: ['./components/**/*.js', './pages/**/*.js'], 9 | defaultExtractor: content => content.match(/[\w-/:]+(? { 8 | link.key = `nav-link-${link.href}-${link.label}` 9 | return link 10 | }) 11 | 12 | const Nav = () => ( 13 | 54 | ) 55 | 56 | export default Nav 57 | -------------------------------------------------------------------------------- /pages/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Link from 'next/link'; 3 | import Head from 'next/head'; 4 | import Nav from '../components/nav'; 5 | 6 | const Home = () => ( 7 |
8 | 9 | Home 10 | 11 | 12 |
89 | ); 90 | 91 | export default Home; 92 | --------------------------------------------------------------------------------