Skip to content

πŸ‘©β€πŸŽ€ CSS-in-JS library designed for high performance style composition

License

Notifications You must be signed in to change notification settings

emotion-js/emotion

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4a234ea Β· Nov 3, 2017
Sep 25, 2017
Nov 2, 2017
Nov 3, 2017
Sep 20, 2017
Sep 13, 2017
Sep 22, 2017
Sep 5, 2017
Oct 20, 2017
Oct 20, 2017
Oct 20, 2017
Oct 23, 2017
Jul 1, 2017
Oct 20, 2017
May 27, 2017
Nov 2, 2017
Aug 16, 2017
Oct 2, 2017
Jul 10, 2017
Oct 23, 2017
Oct 20, 2017
Nov 2, 2017
Oct 16, 2017
Nov 2, 2017

Repository files navigation

emotion

emotion

The Next Generation of CSS-in-JS

npm version Build Status codecov core gzip size core size react gzip size react size slack

emotion is a high performance, lightweight css-in-js library that supports both string and object based styles.


Sponsor


Quick Start

Get up and running with a single import.

npm install --save emotion 
import { css } from 'emotion';

const app = document.getElementById('root');
const myStyle = css`
  color: rebeccapurple;
`
app.classList.add(myStyle);
npm install --save emotion react-emotion babel-plugin-emotion

Note: use preact-emotion in place of react-emotion if using Preact

import styled, { css } from 'react-emotion';

const Container = styled('div')`
  background: #333;
`
const myStyle = css`
  color: rebeccapurple;
`
const app = () => (
<Container>
  <p className={myStyle}>Hello World</p>
</Container>
);

Demo Code Sandbox

Examples

About

The core idea comes from Sunil Pai’s glam library and its philosophy is laid out here.

-- Introduction Article

API

Doc files

Ecosystem

In the Wild