react-styled-class
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

react-styled-class

Just INLINE styles.

import { useStyled } from 'react-styled-class'

export const StyledButton = ({ primary }) => {
  const styled = useStyled()
  return (
    <button
      className={styled(`
        color: gray;
        &:hover {
          color: orange;
        }
      `)}
    >
      Button
    </button>
  )
}

Or you can use style objects.

styled({
  color: 'gray'
})

Equivalent to:

styled(`
  color: gray;
`)

WHY

I'm tired of naming CSS classes (and creating styled components :D).

Readme

Keywords

Package Sidebar

Install

npm i react-styled-class

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

17.3 kB

Total Files

21

Last publish

Collaborators

  • gzzhanghao