0.10.1 • Published 3 years ago

@improv/core v0.10.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

@improv/core

SizeBadge SizeBadge SizeBadge

Tiny framework agnostic CSS-in-JS utilities.

Try it on codesandbox.io.

Features

  • SASS-like nested selectors and ampersand (&) references.
  • CSS value arrays for browser compatibility fallbacks.
  • At-rules (e.g. @media, @keyframes).
  • Tagged templates.
  • Written in Typescript.

Getting Started

import { getStyleSheet } from "@improv/core";

const sheet = getStyleSheet({
  body: {
    padding: 0,
  },
});

API

Utilities

  • getId(prefix?)
    • Returns a unique identifier.
    • This function will work even if multiple versions of this library are in use.
  • getStyleSheet(style?)
    • Returns a <style> element wrapper with utility methods: update(style) and destroy().
  • getStyleText(style, namespaceSelector?)
    • Returns stylesheet text suitable for assignment to HTMLStyleElement.textContent.
  • getBindings(options)
    • Returns framework (e.g. React or Preact) bindings: useStyle(), <Style>.
    • See @improv/react for pre-build React bindings.
    • See @improv/preact for pre-build Preact bindings.
0.10.1

3 years ago

0.10.0

3 years ago

0.9.17

3 years ago

0.9.18

3 years ago

0.9.12

3 years ago

0.9.8

3 years ago

0.9.7-alpha.2

3 years ago

0.9.13

3 years ago

0.9.7

3 years ago

0.9.7-alpha.1

3 years ago

0.9.6-next.0

3 years ago

0.9.14

3 years ago

0.9.15

3 years ago

0.9.9

3 years ago

0.9.4

3 years ago

0.9.10

3 years ago

0.9.11

3 years ago

0.9.5

3 years ago

0.9.6-alpha.0

3 years ago

0.9.16

3 years ago

0.9.7-alpha.0

3 years ago

0.9.3

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.9.0

3 years ago