margins!() { /* proc-macro */ }
Expand description
Make a margin-adjustment widget wrapper
This is a small wrapper which adjusts the margins of its contents.
Example
ⓘ
let a = kas::margins!(1.0 em, "abc");
let b = kas::margins!(vert = none, "abc");
Syntax
The macro takes one of two forms:
Margins:
margins!
(
MarginSpec,
Layout)
margins!
(
MarginDirection=
MarginSpec,
Layout)
MarginDirection :
horiz
|horizontal
|vert
|vertical
|left
|right
|top
|bottom
MarginSpec :
( LitFloatpx
) | ( LitFloatem
) |none
|inner
|tiny
|small
|large
|text
MarginSpec | Description (guide size; theme-specified sizes may vary and may not scale linearly) |
---|---|
none | No margin (0px ) |
inner | A very tiny theme-specified margin sometimes used to draw selection outlines (1px ) |
tiny | A very small theme-specified margin (2px ) |
small | A small theme-specified margin (4px ) |
large | A large theme-specified margin (7px ) |
text | Text-specific margins; often asymmetric |
LitFloat em (e.g. 1.2 em ) | Using the typographic unit Em (1Em is the text height, excluding ascender and descender) |
LitFloat px (e.g. 5.0 px ) | Using virtual pixels (affected by the scale factor) |