Last active
April 26, 2020 23:46
-
-
Save dance2die/23ed6eabd9f9f8928c68120b14abe0b4 to your computer and use it in GitHub Desktop.
Gatsby Recipe for Tailwind CSS with TypeScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const purgecss = require('@fullhuman/postcss-purgecss')({ | |
// Specify the paths to all of the template files in your project | |
content: [ | |
'./src/**/*.html', | |
'./src/**/*.js', | |
'./src/**/*.jsx', | |
'./src/**/*.ts', | |
'./src/**/*.tsx', | |
'./public/index.html', | |
], | |
// Include any special characters you're using in this regular expression | |
defaultExtractor: content => content.match(/[\w-/:]+(?<!:)/g) || [], | |
}); | |
module.exports = { | |
plugins: [ | |
require('tailwindcss'), | |
require('postcss-preset-env'), | |
...(process.env.NODE_ENV === 'production' ? [purgecss, cssnano] : []), | |
], | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See https://tailwindcss.com/docs/configuration for details | |
module.exports = { | |
theme: {}, | |
variants: {}, | |
// https://github.com/tailwindcss/custom-forms | |
plugins: [require("@tailwindcss/custom-forms")], | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! purgecss start ignore */ | |
@tailwind base; | |
@tailwind components; | |
/*! purgecss end ignore */ | |
@tailwind utilities; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment