0.0.12 • Published 5 years ago

@happycat/css v0.0.12

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

CSS

Minimal CSS in JS

Uses Stylis.js and auto-injects style (similar to emotion).

Install

ECMAScript module

<script type="module">
  import css from 'https://npmcdn.com/@happycat/css'
</script>

CommonJS

npm install @happycat/css
import css from '@happycat/css/cjs'

Script tag

<script src="https://npmcdn.com/@happycat/css/iife"></script>
<script>
  // happycat.css
</script>

Use

Simple

const pink = css('color: hotpink;')
document.body.innerHTML = '<h1 class="${pink}">I want it pink!</h1>'

Extend

const style = css(`
  font-size: 4em;
  color: blue;
`)

const pink = 'color: hotpink;'

const text = document.createElement('h1')

text.innerText = 'Hello'
text.className = css(style, pink)

document.body.appendChild(text)
0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago