nano-css icon indicating copy to clipboard operation
nano-css copied to clipboard

Distilled CSS-in-JS for gourmet developers

nano-css

Tiny 5th generation CSS-in-JS library that you can actually use in production. Motto of nano-css is simple: create the smallest possible CSS-in-JS library and provide all features of any other library through addons.

  • Only 0.5 Kb in base configuration, e.g. styled-components is 15.1Kb
  • Library-agnostic — use it standalone, with React, Preact, Vue.js, or any other library
  • Isomorphic — render on server and browser, generates stable class names, and re-hydrates
  • Performantsimply the fastest library; does not create wrapper components, does not use inline styles or inline <style> elements, but caches all styles for re-use and injects CSS using .insertRule() for performance
  • @media queries and animation @keyframes are supported
  • Auto-prefixes your styles
  • Extract CSS into external style sheet
  • Public domainUnlicense license

For pre-configured simple-to-use package see nano-theme, which builds on top of nano-css.

Reference

  • Installation
  • Addons
    • put()demo!
    • rule()demo!
    • drule()demo!
    • sheet()demo!
    • dsheet()demo!
    • jsx()demo!
    • useStyles()demo!
    • withStyles()demo!
    • decoratordemo № 1 and demo № 2
    • componentdemo!
    • style()demo!
    • styled()()demo!
    • hyperstyle()demo!
    • stable
    • atomsdemo!
    • emmet
    • nesting
    • keyframes()
    • hydrate()
    • prefixer
    • stylis
    • unitless
    • !important
    • :global
    • animate/*
    • reset/*
    • reset-font
    • googleFont()
    • limit
    • amp
    • virtual
    • spread
    • array
    • snakedemo!
    • tachyons
    • rtl
    • extract
    • sourcemaps
    • .units
    • cssom
    • vcssom
  • Presets
  • Server-side rendering