A mobile-first breakpoint system with five size steps. Values are written in px on purpose: the design system’s root font is 10px, so a rem media query would not mean what it does elsewhere.
| token | value | description |
|---|---|---|
| sm | 640px | Large phones, small tablets |
| md | 768px | Tablets |
| lg | 1024px | Small desktops, laptops |
| xl | 1280px | Large desktops |
| 2xl | 1536px | Extra large screens |
Styles are applied from the smallest screen up. Breakpoint conditions override base styles at their threshold and above:
import { css } from "@pindoba/styled-system/css";
<div
className={css({
padding: "sm", // Mobile (default)
sm: { padding: "md" }, // 640px+
md: { padding: "lg" }, // 768px+
lg: { padding: "xl" }, // 1024px+
})}
>
Responsive content
</div>;
<div
className={css({
display: "grid",
gridTemplateColumns: "1fr",
gap: "md",
sm: { gridTemplateColumns: "repeat(2, 1fr)" },
lg: { gridTemplateColumns: "repeat(3, 1fr)" },
})}
>
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
</div>
<div className={css({
display: "block",
md: { display: "none" },
})}>
Mobile only
</div>
<div className={css({
display: "none",
md: { display: "block" },
})}>
Desktop only
</div>
padding: { base: "sm", md: "lg" }) rather than fixed values