use-css

0.0.10 • Public • Published



Silly React hook for CSS

Demo on CodeSandbox

 

install

npm install use-css

 

usage

import useCSS from 'use-css'
 
function Oopsy(props) {
  const className = useCSS(`
    font-size: 21px;
    font-style: italic;
    color: ${props.color};
    &:hover {
      font-weight: bold;
    }
  `)
 
  return <div className={className}>because why not?</div>
}
 
render(<Oopsy color="green" />)

 

but why?

funsies

like it?

⭐️ this repo

 

license

MIT © siddharthkp

/use-css/

    Package Sidebar

    Install

    npm i use-css

    Weekly Downloads

    1

    Version

    0.0.10

    License

    MIT

    Unpacked Size

    4.93 kB

    Total Files

    7

    Last publish

    Collaborators

    • siddharthkp