use-css

Silly React hook for CSS

Usage no npm install needed!

<script type="module">
  import useCss from 'https://cdn.skypack.dev/use-css';
</script>

README



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?

:star: this repo

 

license

MIT © siddharthkp