New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@chakra-lite/css

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chakra-lite/css

A tiny (1kb) alternative to the popular emotion library for react AND preact

latest
Source
npmnpm
Version
3.0.14
Version published
Weekly downloads
9
350%
Maintainers
1
Weekly downloads
 
Created
Source

@chakra-lite/css

A tiny (1kb) alternative to the popular emotion library for react AND preact

Sister packages:

  • @chakra-lite/styled
  • @chakra-lite/react

Pros:

  • Much less bundle size and runtime sluggishness
  • Less is more: less bugs, no breaking changes
  • Compatible with preact and react
  • Supports declaring css inside of Components for better code colocating and NO MORE NEED TO PASS ARGS!
  • Supports css AND tss - a tab based css

Cons:

  • No SSR support

Setup/Install

npm i @chakra-lite/css

Tip: Set "moduleResolution": "NodeNext" in tsconfig.json to get the best typescript experience

Usage

Preview below. For full code, see demo folder

// Add some global styles
css`
  body {
    color: lightgray;
  }
`

// Also works with tab syntax (tss)
css`
 body
  background: black
 @media (width > 500px)
  body
   background: #333
`

export function App() {
  const on = useOn()

  // Feel free to declare css inside components!
  const fontWeight = on ? 'bold' : 'initial'

  css`
    body
      font-weight: ${fontWeight}
  `
  return <div>This should be black or gray background, lightgray font, {fontWeight} weight</div>
}

Comparisons

Emotion

  • A popular css-in-js lib that this lib is based on

Pros

  • Very feature rich

Cons

  • Is large (~11kb)

Keywords

chakra

FAQs

Package last updated on 23 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts