@saulpalv/use-responsive-class-effect
v1.0.0
Published
An effect hook for setting css responsive class names on the root node using breakpoint definitions
Downloads
4
Maintainers
Readme
A react hook for getting a variable previous state
Install
npm i @saulpalv/use-responsive-class-effect
//or
yarn add @saulpalv/use-responsive-class-effect
Usage
import { muiBreakPoints, useResponsiveClassNameEffect } from "@saulpalv/use-responsive-class-effect"
export const App = () => {
const className = useResponsiveClassNameEffect(muiBreakPoints)
return (
<div css={{
/**
* Blue background style applied on medium (md) breakpoint
* range 1200px > windows width > 900px
*/
'.md &': { backgroundColor: 'blue' }
}}>
hello
</div>
)
}