33This plugin will add [ Tailwind] ( http://tailwindcss.com ) to your
44[ Gridsome] ( http://gridsome.org ) project.
55
6- ** Currently working on v3, which will remove PurgeCSS capabilities**
7-
8- * (because Tailwind 1.4+ has it baked in)*
9-
106## Who This Is For
117
128If you want to set up Tailwind with the least amount of effort in a Gridsome
13- project, this is for you. If you want to lean in to the * Way of
14- Tailwind * &mdash ; using ` tailwind.config.js ` or keep your CSS inside your Vue
9+ project, this is for you. If you want to lean in to the _ Way of
10+ Tailwind _ &mdash ; using ` tailwind.config.js ` or keep your CSS inside your Vue
1511files' style blocks&mdash ; this is the plugin for you. If you want to have a
1612global CSS file and dump a bunch of crap in there, you'll wind up fighting this
1713plugin.
@@ -20,7 +16,6 @@ plugin.
2016
2117` npm install -D gridsome-plugin-tailwindcss `
2218
23-
2419## Usage
2520
2621I've gone ahead and automatically imported the default ` tailwind.css ` file from
@@ -36,8 +31,7 @@ You may be wondering, "Where do I add global CSS?!" Short answer, you don't.
3631Long answer, read the Tailwind docs on [ creating plugins] [ plugins ] and use
3732` tailwind.config.js ` to add base styles and create components/utilities there.
3833
39- ** If you need to create ` tailwind.config.js ` , run `./node_modules/.bin/tailwind
40- init` to create one.**
34+ ** If you need to create ` tailwind.config.js ` , run ` ./node_modules/.bin/tailwind init ` to create one.**
4135
4236[ plugins ] : https://tailwindcss.com/docs/plugins/#app
4337
@@ -49,55 +43,29 @@ Set any options you want to set in `gridsome.config.js`.
4943module .exports = {
5044 plugins: [
5145 {
52- use: ' gridsome-plugin-tailwindcss' ,
46+ use: " gridsome-plugin-tailwindcss" ,
5347 /**
5448 * These are the default options. You don't need to set any options to get
5549 * going. Seriously, you don't need to declare tailwind.config.js.
5650
5751 options: {
5852 tailwindConfig: './tailwind.config.js',
59- purgeConfig: {},
6053 presetEnvConfig: {},
61- shouldPurge: true,
6254 shouldImport: true,
6355 shouldTimeTravel: true
6456 }
6557 */
66- }
67- ]
68- }
58+ },
59+ ],
60+ };
6961```
7062
7163** If you don't supply a config file path, Tailwind defaults will be used.**
7264
73-
74-
7565## Plugins
7666
7767The following PostCSS plugins are also included with this plugin:
7868
79- ### PurgeCSS
80-
81- [ PurgeCSS] ( https://www.purgecss.com/with-postcss ) is enabled by default. If
82- you'd like to disable it, pass ` shouldPurge:false ` to the plugin options
83- object.
84-
85- ### postcss-import
86-
87- [ postcss-import] ( https://github.com/postcss/postcss-import ) included by
88- default. Pass ` shouldImport: false ` to disable.
89-
90- ### postcss-preset-env
91-
92- [ postcss-preset-env] ( https://github.com/csstools/postcss-preset-env ) included
93- by default. Pass ` shouldTimeTravel: false ` to disable. You may also pass a
94- config object to the plugin as ` presetEnvConfig ` .
95-
96- With this one plugin, you should be ready to use Tailwind right away. Keep your
97- customization to ` tailwind.config.js ` whenever possible, but you can use the
98- full power of Tailwind (including ` @apply ` ) in your Vue components when
99- necessary.
100-
10169## Examples
10270
10371- [ 🍸 Aperitif &mdash ; A delectable starter template for your next Gridsome project.] ( https://github.com/brandonpittman/aperitif )
0 commit comments