@size
Width and height in one declaration, with paper size presets.
Syntax
- @size: <size>
- @size: <width> <height>
- @size: <width> auto <ratio>
- @size: <preset> [portrait | landscape]
- width, height
- Any CSS length. The height defaults to the width.
- ratio
- Used as
aspect-ratiowhen the width or the height isauto, written as4/3or(4/3). - preset
- A name from the list below. Landscape unless
portraitorpis given.lis landscape.
| Preset | Landscape | Portrait |
|---|---|---|
a0 | 1189 × 841 mm | 841 × 1189 mm |
a1 | 841 × 594 mm | 594 × 841 mm |
a2 | 594 × 420 mm | 420 × 594 mm |
a3 | 420 × 297 mm | 297 × 420 mm |
a4 | 297 × 210 mm | 210 × 297 mm |
a5 | 210 × 148 mm | 148 × 210 mm |
a6 | 148 × 105 mm | 105 × 148 mm |
postcard | 148 × 100 mm | 100 × 148 mm |
poster | 540 × 390 mm | 390 × 540 mm |
Written at the top level it sizes every cell. On :doodle it sizes the component.
The / modifier of @grid takes the same value.
On a cell, @size also records the size for @place.
Examples
@grid: 1 / 60vmin;
/* width: 10em; height: 10em; */
@size: 10em;
/* width: 10em; height: 6em; */
@size: 10em 6em; Random sizes with a fixed ratio:
@grid: 5 / 60vmin _1px;
@size: @r(30%, 90%) auto 3/2;
margin: auto;
background: #000; A paper preset:
@grid: 1 / a6 portrait;
/* equals */
:doodle {
width: 105mm;
height: 148mm;
}