style()
constructs a marquee_style
object specifying the styling for a
single tag. The meaning of NULL
is to inherit the value from the parent
element. It follows that top parent (the body element), must have values for
all it's options. The base_style()
constructor is a convenient constructor
for a style with sensible defaults for all it's options.
style(
family = NULL,
weight = NULL,
italic = NULL,
width = NULL,
features = NULL,
size = NULL,
color = NULL,
lineheight = NULL,
align = NULL,
tracking = NULL,
indent = NULL,
hanging = NULL,
margin = NULL,
padding = NULL,
background = NULL,
border = NULL,
border_size = NULL,
border_radius = NULL,
bullets = NULL,
underline = NULL,
strikethrough = NULL,
baseline = NULL,
img_asp = NULL,
text_direction = NULL
)base_style(
family = "",
weight = "normal",
italic = FALSE,
width = "normal",
features = systemfonts::font_feature(),
size = 12,
color = "black",
lineheight = 1.6,
align = "auto",
tracking = 0,
indent = 0,
hanging = 0,
margin = trbl(0, 0, rem(1)),
padding = trbl(0),
background = NA,
border = NA,
border_size = trbl(0),
border_radius = 0,
bullets = marquee_bullets,
underline = FALSE,
strikethrough = FALSE,
baseline = 0,
img_asp = 1.65,
text_direction = "auto"
)
A marquee_style
object
The name of the font family to use
The font weight to use. Can either be a number (0
, 100
,
200
, 300
, 400
, 500
, 600
, 700
, 800
, or 900
) or a strings
("undefined"
, "thin"
, "ultralight"
, "light"
, "normal"
, "medium"
,
"semibold"
, "bold"
, "ultrabold"
, or "heavy"
)
Should the font be slanted
The font width to use. Can either be a number (``0,
1`, `2`,
`3`, `4`, `5`, `6`, `7`, `8`, or `9`) or strings (`"undefined"`,
`"ultracondensed"`, `"extracondensed"`, `"condensed"`, `"semicondensed"`,
`"normal"`, `"semiexpanded"`, `"expanded"`, `"extraexpanded"`, or
`"ultraexpanded"`)
A font_feature object specifying any OpenType font features to apply to the font
The size of the font in points. Can be relative()
or em()
in
which case it is based on the parent font size (for size
these are
equivalent) or rem()
in which case it is based on the font size of the body
element.
Is the color of the font
The spacing between subsequent lines relative to the font
size. Can be relative()
in which case it is based on the parent lineheight.
The alignment within the text. One of "left"
, "center"
,
"right"
, "justified-left"
, "justified-center"
, "justified-right"
, or
"distributed"
Additional character spacing measured in 1/1000em. Can be
relative()
in which case it is based on the parent tracking.
The indentation of the first line in a paragraph measured in
points. Can be relative()
in which case it is based on the parent indent,
em()
in which case it is based on the font size in this style, or rem()
in which case it is based on the font size of the body element.
The indentation of all but the first line in a paragraph
measured in points. Can be relative()
in which case it is based on the
parent hanging, em()
in which case it is based on the font size in this
style, or rem()
in which case it is based on the font size of the body
element.
The margin around the element, given as a call to trbl()
.
Margin refers to the area outside the box that text is placed in. If the
element has a background, the margin area will not be colored.
The padding around the element, given as a call to trbl()
.
Padding refers to the distance between the text and the border of the box it
will be drawn in. If the element has a background, the padding area will be
colored.
The color of the background fill. The background includes
the padding but not the margin. Can be a solid color or a gradient or pattern
made with grid::linearGradient()
/grid::radialGradient()
/grid::pattern()
The color of the background stroke. The background includes the padding but not the margin
The line width of the background stroke, given as a call
to trbl()
The corner radius of the background, given in points
A vector of strings to use for bullets in unordered lists.
marquee_bullets
provides a selection
Should text be underlined
Should text be strikethrough
The baseline shift to apply to the text
The default aspect ratio for block level images if not provided by the image itself
The directional flow of the text. Either "auto"
to
let it be determined by the content of the text, or "ltr"
/"rtl"
to
hard-code it to either left-to-right or right-to-left. This setting will not
change the order of glyphs within a span of text, but rather whether
consequtive blocks of text are laid out left-to-right or right-to-left. It
also affects to which side indentation is applied as well as the meaning of
"auto"
, and "justified-auto"
aligment.
# A partial style
style(color = "red", underline = TRUE)
# Full style
base_style()
Run the code above in your browser using DataLab