Skip to content

Instantly share code, notes, and snippets.

View geekysrm's full-sized avatar
👋
Hey, how are you?

Soumya Ranjan Mohanty geekysrm

👋
Hey, how are you?
View GitHub Profile
@geekysrm
geekysrm / default-tailwind-config.js
Created October 20, 2020 17:07
default-tailwind-config
// tailwind.config.js
module.exports = {
future: {},
purge: [],
theme: {
extend: {},
},
variants: {},
plugins: [],
};
npm install tailwindcss -D
# -D installs it as a dev dependency
import React from "react"
import tw from "tailwind.macro"
import styled from "@emotion/styled"
const MyComponent = styled.div`
${tw`bg-white
rounded-lg
overflow-hidden
border`}
height: 409px;
import React from "react"
import tw from "tailwind.macro"
const MyComponent = tw.div`
bg-white
rounded-lg
overflow-hidden
border
`
import React from "react";
import tw from "tailwind.macro";
const MyComponent = (
<h4 css={tw`font-semibold text-lg leading-snug truncate`}>This is Soumya</h4>
);
export default MyComponent;
// Edit the path to where you have kept the globals.css file
import "./src/styles/globals.css"
@tailwind base;
@tailwind utilities;
plugins: [
...
{
resolve: `gatsby-plugin-postcss`,
options: {
// Accepts all options defined by `gatsby-plugin-postcss` plugin.
},
},
{
resolve: `gatsby-plugin-emotion`,
@geekysrm
geekysrm / gatsby-tailwind-3.sh
Last active February 6, 2020 11:19
Now install Emotion packages and tailwind-micro:
npm i @emotion/core @emotion/styled tailwind.macro@next gatsby-plugin-postcss postcss-import postcss-preset-env
# We are installing the 'next' version of tailwind micro so as to use TailwindCSS 1.0.0+
# For older versions of TailwindCSS, just install 'tailwind.macro'
@geekysrm
geekysrm / gatsby-tailwind-2.sh
Created February 6, 2020 11:08
Install Tailwind and generate Tailwind config file
# Install Tailwind:
npm install tailwindcss --save-dev
# Generate Tailwind config:
npx tailwind init