Git Product home page Git Product logo

gatsby-typescript-tailwind-emotion-starter's Introduction

Gatsby Typesript Tailwind Emotion Starter

Quick Start

Create a Gatsby site

Use the Gatsby CLI to create a new site, specifying the Lumen starter.

gatsby new my-new-website https://github.com/burnsy/gatsby-typescript-tailwind-emotion-starter

Start Developing

Navigate into your new site’s directory and start it up.

cd my-new-website
gatsby develop

Usage

Develop

npm run develop

Build

npm run build

Your built file will be in /public

How do i use this?

import React from 'react'
import tw from 'tailwind.macro';
import styled from '@emotion/styled';

// like this 
const Container = styled.div`
  ${tw`py-8`};
`
// or this
const Text = styled.p(tw`bg-black text-white`);

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

export default Home

Why would I use it?

Becuase you would like to use Tailwind CSS with Typescript & JS-IN-CSS. You know how awesome it utility first CSS.

Compared to CSS framework like Bootstrap, Tailwind CSS gives you alot of class as utilities. The file size gets bloated. In fact it's 1.5 times bigger than Bootstrap. (https://tailwindcss.com/docs/controlling-file-size )

CSS-in-JS to save.

Fortunately, you can use CSS-in-JS like Emotion, to only load needed styles. So you can keep you css size small.

Furthremore, CSS-in-JS is just awesome. CSS in JS: Benefits, Drawbacks, and Tooling

Why Gatsby? Because Gatsby is blazing fast, and comes with alot of plugins

For more information

Contributing

Insperation

This template was built of and is an updated version of react-tailwind-emotion-starter. Thanks you to muhajirdev.

Enjoy!

gatsby-typescript-tailwind-emotion-starter's People

Contributors

burnsy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.