1.0.0 • Published 9 months ago

pretty-lights v1.0.0

Weekly downloads
3,519
License
UNLICENSED
Repository
github
Last release
9 months ago

pretty-lights

Pretty Lights is a performant and flexible CSS-in-JS library. Building on many other CSS-in-JS libraries, it allows you to style apps quickly with string or object styles. It has predictable composition to avoid specificity issues with CSS. With source maps and labels, Pretty Lights has a great developer experience and great performance with heavy caching in production.

Build Status

Installation

npm i --save pretty-lights
yarn add pretty-lights

Usage

To use it, import what you need.

css

Use css to create class names with styles.

import { css } from 'pretty-lights';

const className = css`
  color: hotpink;
`;

const SomeComponent = ({ children }) => (
  <div className={className}>Some hotpink text.{children}</div>
);

const anotherClassName = css({
  textDecoration: 'underline',
});

const AnotherComponent = () => <div className={anotherClassName}>Some text with an underline.</div>;

styled

styled is a way to create React components that have styles attached to them.

import { styled } from 'pretty-lights';

const Button = styled('button')`
  color: hotpink;
`;

render(<Button>This is a hotpink button.</Button>);

pretty-lights/babel

Pretty Lights has an optional Babel plugin that optimizes styles by compressing and hoisting them and creates a better developer experience with source maps and labels.

Instructions on using the Babel plugin: docs

Documentation

https://nytimes.github.io/pretty-lights

Core API

Styled Components

Theming

SSR

Jest

Babel

ESLint

1.0.0

9 months ago

0.1.0

2 years ago

0.1.0-alpha.0

2 years ago

0.0.23

2 years ago

0.0.24

2 years ago

0.0.25

2 years ago

0.0.26

2 years ago

0.0.21

3 years ago

0.0.22

2 years ago

0.0.20

3 years ago

0.0.19

4 years ago

0.0.18

4 years ago

0.0.16

4 years ago

0.0.17

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.12-alpha.7

4 years ago

0.0.12-alpha.6

4 years ago

0.0.12-alpha.5

4 years ago

0.0.12-alpha.4

4 years ago

0.0.12-alpha.3

4 years ago

0.0.12-alpha.2

4 years ago

0.0.12-alpha.1

4 years ago

0.0.12-alpha.0

4 years ago

0.0.11

4 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago

0.0.0

8 years ago