Support for responsive props
Author: afzalsayed96Created Nov 24, 2020Updated Sep 14, 2026
Labelsfeature: proposal 💬
Describe the feature
Is there a way to implement responsive props with linaria similar to https://github.com/emotion-js/facepaint?
Motivation
When implemening a primitive component using Box or Text, it is absolutely necessary to support responsive behaviour.
Currently it is only possible to control props supplied to component externally such as
const isMobile = useMediaQuery(breakpoints.MOBILE)
<Box padding={isMobile ? 20 : 40} />Possible implementations
It would be great if we could do something like:
<Box padding={[20, 40]} />which could generate css media queries based on a static config.
Related Issues
Probably #465
Source: callstack/linaria