Initialize media query
import { styled, css } from 'styled-components' import MqInit from 'styled-components-media-query' // initialize const bp = {s: 400, sl: 500, m: 768, ml: 992, l: 1100} const mq = MqInit({ bp }) // use like this const ComponentStyled = styled.div` position: relative; ${mq('m')(css` position: absolute; `)} ${mq('l')(css` position: fixed; `)} `
A styled-component css string.
Generated using TypeDoc
Initialize media query
Usage
import { styled, css } from 'styled-components' import MqInit from 'styled-components-media-query' // initialize const bp = {s: 400, sl: 500, m: 768, ml: 992, l: 1100} const mq = MqInit({ bp }) // use like this const ComponentStyled = styled.div` position: relative; ${mq('m')(css` position: absolute; `)} ${mq('l')(css` position: fixed; `)} `