Spacing
Rosetta includes margin, padding, and gap helpers classes to modify spacing between elements.
Breakpoints modifiers
Sizes
Here are the sizes for all spacing helpers on a based 16px font size:
| Suffix | rem | px |
|---|---|---|
*-none |
0 | 0 |
*-xss |
.75rem | 12px |
*-xs |
1.25rem | 20px |
*-sm |
2.5rem | 40px |
*-md |
3.75rem | 60px |
*-lg |
5rem | 80px |
*-xl |
7.5rem | 120px |
Margin & Padding
Rosetta provides margin and padding in all directions:
*-topfor top*-righfor right*-bottomfor bottom*-leftfor left*-xfor left and right*-yfor top and bottom
These suffix needs to be combined with margin/padding prefix:
for
margin-top, usemargint-top-<value>for
padding-bottom, usepadding-bottom-<value>for
padding-right, usepadding-right-<value>for
marginin all sides, usemargin-<value>for
paddingin all sides, usepadding-<value>for
paddingin the Y axis, usepadding-y-<value>
...and so on.
- E.g margin and padding
Gap
For CSS Grid and Flexbox you can use the gap helper combined with a size suffix:
- E.g
gap-sm:10px
Variables
:root {
--space-none: 0;
--space-xxs : .75rem; // 12px
--space-xs : 1.25rem; // 20px
--space-sm : 2.5rem; // 40px
--space-md : 3.75rem; // 60px
--space-lg : 5rem; // 80px
--space-xl : 7.5rem; // 120px
}