A pretty custom hooks for css variable and react.
- type-safe!
// npm
npm install --save use-css-variable
// yarn
yarn add use-css-variable
import React, { FC } from 'react'
import { useCSSVariable } from 'use-css-variable'
export const Component: FC = () => {
const [foo, setFoo] = useCSSVariable('foo') // --foo
}
See the API for more details
support
- hsl
- hsla
- radian