New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-static-plugin-tailwindcss

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-static-plugin-tailwindcss

A React-Static plugin that adds tailwindcss into your postcss plugins

latest
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

A React-Static plugin that adds tailwind support

npm version License: MIT

Installation

In an existing react-static site run:

$ yarn add react-static-plugin-tailwindcss -D

Then add the plugin to your static.config.js:

export default {
  plugins: ["react-static-plugin-tailwindcss"]
};

Now you can add @tailwind directives to your .css files

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

CSS-in-JS

If you're wanting to use tailwind in conjuction with styled-components for example

yarn add tailwind.macro@next

static.config.js

export default {
  plugins: [
    ["react-static-plugin-tailwindcss", {
      cssInJs: true
    }]
  ]
};

Create a babel-plugin-macros.config.js file

module.exports = {
    tailwind: {
        config: './tailwind.config.js',
        format: 'auto'
    }
}

Now you can use the tw macro inside styled components

import tw from "tailwind.macro";
import styled from "styled-components"

export const Header = styled.h1`
  ${tw`text-4xl font-bold text-center text-blue-500`}
`;

Autoprefixer

If you already handle auto prefixer or dont want to use it

export default {
  plugins: [
    ["react-static-plugin-tailwindcss", {
      autoPrefixer: false
    }]
  ]
};

Keywords

react-static

FAQs

Package last updated on 16 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts