Skip to contents

Control the size of the mascot in pixels or as a percentage. Percentage sizes follow the parent's content width when inline, and the window width when floating. The rendered canvas is never smaller than 24 CSS pixels. Screens at most 575.98 CSS pixels wide use small_screen (floating mascots scale down to a phone size by default). The full character is drawn at every size; fine face details are harder to read at 32 and 24 pixels, so the status text carries the meaning.

Usage

mascot_size(size = 160, ..., small_screen = "auto")

Arguments

size

A finite number of CSS pixels (at least 24), or a positive percentage string such as "20%". Defaults to 160; NULL is not accepted.

...

Must be empty. Forces the arguments after it to be named.

small_screen

An optional size for small screens (at most 575.98 CSS pixels wide). "auto" (the default) scales floating mascots down on phones to at most 96 pixels while leaving inline mascots unchanged. NULL keeps the same size on every screen. A number of pixels or a percentage string sets the phone size explicitly for both floating and inline mascots.

Value

A mascot_size object. Its fields are internal; pass it on rather than reading them.

Examples

mascot_size()
#> mascot_size()
mascot_size("20%")
#> mascot_size("20%")
mascot_size(120, small_screen = 48)
#> mascot_size(120, small_screen = 48)
mascot_size(120, small_screen = NULL)
#> mascot_size(120, small_screen = NULL)