All Projects → muhajirdev → gatsby-plugin-tailwindcss

muhajirdev / gatsby-plugin-tailwindcss

Licence: other
Plug Tailwind CSS to your Gatsby website

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to gatsby-plugin-tailwindcss

Gatsby V2 Tutorial Starter
Gatsby V2 Starter - product of step by step tutorial
Stars: ✭ 139 (+202.17%)
Mutual labels:  gatsby, emotion
gatsby-plugin-open-graph-images
🖼 Open-Graph Images derived and generated from React Components
Stars: ✭ 16 (-65.22%)
Mutual labels:  gatsby, gatsby-plugin
Gatsby Starter Portfolio Emma
Minimalistic portfolio with full-width grid, page transitions, support for additional MDX pages, and a focus on large images. Especially designers and/or photographers will love this theme! Built with MDX and Theme UI.
Stars: ✭ 253 (+450%)
Mutual labels:  gatsby, emotion
chandrikadeb7.github.io
Personal portfolio website hosted using GitHub Pages - Version 2
Stars: ✭ 99 (+115.22%)
Mutual labels:  gatsby, gatsby-plugin
gatsby-graphcms-example
Example of Gatsby source plugin for GraphCMS
Stars: ✭ 32 (-30.43%)
Mutual labels:  gatsby, gatsby-plugin
Gatsby Starter Portfolio Emilia
Minimalistic portfolio/photography site with masonry grid, page transitions and big images. Themeable with Theme UI. Includes Light/Dark mode.
Stars: ✭ 300 (+552.17%)
Mutual labels:  gatsby, emotion
gatsby-theme-jam-example
An example submission for the Gatsby Theme Jam.
Stars: ✭ 89 (+93.48%)
Mutual labels:  gatsby, gatsby-plugin
gatsby-plugin-dynamic-routes
Creating dynamic routes based on your environment and/or renaming existing routes
Stars: ✭ 14 (-69.57%)
Mutual labels:  gatsby, gatsby-plugin
gatsby-remark-images-anywhere
Handle images with relative, absolute & remote path for gatsby-transformer-remark & gatsby-plugin-mdx
Stars: ✭ 22 (-52.17%)
Mutual labels:  gatsby, gatsby-plugin
gatsby-theme-dox
Documentation made easy with Gatsby. 🎉
Stars: ✭ 29 (-36.96%)
Mutual labels:  gatsby, gatsby-plugin
gatsby-theme-nehalem
A Gatsby blog theme.
Stars: ✭ 168 (+265.22%)
Mutual labels:  gatsby, gatsby-plugin
Gatsby-Starter-Typescript-Apollo-Storybook
Starter with the bare essentials needed for a typescript, apollo, storybook, emotion Gatsby site
Stars: ✭ 17 (-63.04%)
Mutual labels:  gatsby, emotion
gatsby-plugin-robots-txt
Gatsby plugin that automatically creates robots.txt for your site
Stars: ✭ 105 (+128.26%)
Mutual labels:  gatsby, gatsby-plugin
Gatsby Starter Prismic
A typography-heavy & light-themed Gatsby Starter which uses the Headless CMS Prismic.
Stars: ✭ 381 (+728.26%)
Mutual labels:  gatsby, emotion
gatsby-theme-deck-n-blog
Create a deck (with mdx-deck) and a blog post from the same MDX
Stars: ✭ 17 (-63.04%)
Mutual labels:  gatsby, gatsby-plugin
gatsby-remark-classes
Automatically add class attributes to markdown elements
Stars: ✭ 12 (-73.91%)
Mutual labels:  gatsby, gatsby-plugin
gatsby-source-moltin
🚀 Gatsby source plugin for building Elastic Path Commerce Cloud powered eCommerce websites
Stars: ✭ 21 (-54.35%)
Mutual labels:  gatsby, gatsby-plugin
gatsby-theme-gallery
🏞 A Gatsby Theme for adding a gallery to your site.
Stars: ✭ 40 (-13.04%)
Mutual labels:  gatsby, gatsby-plugin
gatsby-typescript-emotion-storybook
Gatsby Starter: TypeScript + Emotion + Storybook + React Intl + SVGR + Jest
Stars: ✭ 63 (+36.96%)
Mutual labels:  gatsby, emotion
gatsby-plugin-asset-path
Move all of your JS and CSS build files, as well as the static folder into a subdirectory of your choice
Stars: ✭ 14 (-69.57%)
Mutual labels:  gatsby, gatsby-plugin

Gatsby Plugin Tailwind CSS

What

A Gatsby plugin to use Tailwind CSS with css-in-js. Like styled-components or emotion.js

TL;DR

If you want to quickly use Gatsby + Tailwind CSS + EmotionJS. There's already gatsby-tailwind-emotion-starter

Installation

Inside your Gatsby project

npm install --save gatsby-plugin-tailwindcss tailwindcss

Init Tailwind configuration

./node_modules/.bin/tailwind init

It will add tailwind.js to your root project

Add this plugin to your gatsby-config.js.

module.exports = {
  plugins: ['gatsby-plugin-tailwindcss'],
}

Add tw global to your .eslintrc

{
 ...
  "globals": {
    "tw": true
  },
 ...
}

You can now use Tailwind CSS with your favorite CSS-in-JS

This plugin use babel-plugin-tailwind-components under the hood.

Usage

With Emotion

Install gatsby-plugin-emotion

In your React Component

import React from 'react'
import styled from 'react-emotion'


const Container = styled.div`
  ${tw`py-8`};
`
const Text = styled.p`
  ${tw`bg-black text-white`};
`

const Home = () => (
  <Container>
    <Text>I am Text component made with Tailwind CSS + EmotionJS</Text>
  </Container>
)

export default Home

With Styled Components

Install gatsby-plugin-styled-components.

In your React Component

import React from 'react'
import styled from 'styled-components'


const Container = styled.div`
  ${tw`py-8`};
`
const Text = styled.p`
  ${tw`bg-black text-white`};
`

const Home = () => (
  <Container>
    <Text>I am Text component made with Tailwind CSS + Styled Components</Text>
  </Container>
)

export default Home

Using Vscode

Try this snippet plugin vscode-tailwind-styled-snippets

For more information

Contributing

Related

I recently uses monad-ui. If you love tailwind, you might wanna try it too :)

Enjoy!

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].