All Projects → brandonpittman → Gridsome Plugin Tailwindcss

brandonpittman / Gridsome Plugin Tailwindcss

Licence: mit
A Tailwind plugin for Gridsome.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Gridsome Plugin Tailwindcss

Gp Vue Boilerplate
Grabarz & Partner Boilerplate is a professional front-end template for building fast, robust, and adaptable web apps or sites with vuejs.
Stars: ✭ 71 (-29%)
Mutual labels:  postcss
React Base
atSistemas React/Redux Isomorphic Platform
Stars: ✭ 82 (-18%)
Mutual labels:  postcss
Uncss
Remove unused styles from CSS
Stars: ✭ 9,170 (+9070%)
Mutual labels:  postcss
Stylelint
A mighty, modern linter that helps you avoid errors and enforce conventions in your styles.
Stars: ✭ 9,350 (+9250%)
Mutual labels:  postcss
Postcss Elm Tailwind
put some tailwind in your elm
Stars: ✭ 80 (-20%)
Mutual labels:  postcss
Minna Ui
😸 A fast, friendly, and fun web UI kit for everyone.
Stars: ✭ 86 (-14%)
Mutual labels:  postcss
Astexplorer.app
https://astexplorer.net with ES Modules support and Hot Reloading
Stars: ✭ 65 (-35%)
Mutual labels:  postcss
Shortstack
🥞 minimal Rollup + PostCSS modern syntax starter template
Stars: ✭ 94 (-6%)
Mutual labels:  postcss
Cessie
Transpile your CSS bundle to support CSS variables, calc, and future CSS for legacy browsers.
Stars: ✭ 81 (-19%)
Mutual labels:  postcss
React Boilerplate
This project is deprecated. Please use CRA instead.
Stars: ✭ 88 (-12%)
Mutual labels:  postcss
Postcss Prefix Selector
Prefix all CSS rules with a selector
Stars: ✭ 75 (-25%)
Mutual labels:  postcss
Postcss Modules Example
How to use postcss-modules plugin
Stars: ✭ 78 (-22%)
Mutual labels:  postcss
Postcss Grid Kiss
A PostCSS plugin to keep CSS grids stupidly simple
Stars: ✭ 1,270 (+1170%)
Mutual labels:  postcss
Starter Lapis
Cutting edge starter kit
Stars: ✭ 72 (-28%)
Mutual labels:  postcss
Postcss Font Family System Ui
PostCSS plugin to transform W3C CSS font-family: system-ui to a practical font-family list
Stars: ✭ 91 (-9%)
Mutual labels:  postcss
Bathe
The simplest WordPress starter theme including full setup for Sass, PostCSS, Autoprefixer, stylelint, Webpack, Eslint, imagemin, Browsersync, etc.
Stars: ✭ 65 (-35%)
Mutual labels:  postcss
Lit Loader
LitElement Single File Component loader for Webpack.
Stars: ✭ 84 (-16%)
Mutual labels:  postcss
Ember Cli Postcss
🔥 A Postcss integration for ember-cli
Stars: ✭ 97 (-3%)
Mutual labels:  postcss
Postcss Less
PostCSS Syntax for parsing LESS
Stars: ✭ 93 (-7%)
Mutual labels:  postcss
Postcss Foft Classes
A postcss plugin to automatically add classes for various font loading strategies.
Stars: ✭ 87 (-13%)
Mutual labels:  postcss

🚨 If you get errors about PostCSS v8, check out Tailwind's docs for the latest info about the compat version.

gridsome-plugin-tailwindcss

This plugin will add Tailwind to your Gridsome project.

Who This Is For

If you want to set up Tailwind with the least amount of effort in a Gridsome project, this is for you. If you want to lean in to the Way of Tailwind—using tailwind.config.js or keep your CSS inside your Vue files' style blocks—this is the plugin for you. If you want to have a global CSS file and dump a bunch of shit in there, you should look elsewhere.

Install

npm install -D gridsome-plugin-tailwindcss [email protected]

npm install -D postcss-import postcss-preset-env #(if you want these plugins and you've updated the config)

Usage

I've gone ahead and automatically imported the default tailwind.css file from the Tailwind npm package. It's just add a CSS file that includes:

@tailwind base;
@tailwind components;
@tailwind utilities;

You do not need to import Tailwind into a CSS file.

You may be wondering, "Where do I add global CSS?!" Short answer, you don't. Long answer, read the Tailwind docs on creating plugins and use tailwind.config.js to add base styles and create components/utilities there.

If you need to create tailwind.config.js, run ./node_modules/.bin/tailwind init to create one.

Customize

Set any options you want to set in gridsome.config.js.

module.exports = {
  plugins: [
    {
      use: "gridsome-plugin-tailwindcss",
      /**
      * These are the default options.

      options: {
        tailwindConfig: './tailwind.config.js',
        presetEnvConfig: {},
        shouldImport: false,
        shouldTimeTravel: false
      }
      */
    },
  ],
};

If you don't supply a config file path, Tailwind defaults will be used.

Plugins

The following PostCSS plugins can be enabled if you install their dependencies.

postcss-import

Install postcss-import and pass shouldImport: true to enable.

postcss-preset-env

Install postcss-preset-env and pass shouldTimeTravel: true to enable. You may also pass a config object to the plugin as presetEnvConfig.

With this one plugin, you should be ready to use Tailwind right away. Keep your customization to tailwind.config.js whenever possible, but you can use the full power of Tailwind in your Vue components when necessary.

Examples

Happy coding!

Buy Me A Coffee

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].