query
A utility function for composing an inline media query string in CSS.
Specification
query({ from: 'md' })
// (min-width: 768px)Example
Exact breakpoint
import styled from 'styled-components'
import { query } from 'atomic-layout'
export const Example = styled.div`
font-size: 14px;
/* Targets the "lg" breakpoint only */
@media ${query({ for: 'lg' })} {
font-size: 16px;
}
`High-pass breakpoint range
Low-pass breakpoint range
Bell breakpoint range
Notch breakpoint range
Using custom breakpoints
Last updated