getDeclaration: Get the value of a CSS declaration

Description Usage Arguments Value Author(s) See Also Examples

Description

This function gets the value associated with an individual declaration within a CSS rule set.

Usage

1
getDeclaration(x, what, default = NA, simplify = TRUE)

Arguments

x

the CSSRuleSet or native RULESET object obtained from the parsed CSS document

what

character giving the name of the property of interest, e.g. "color", "background-color", "padding", "font-family"

default

the value to return if there is no declaration for the specified property

simplify

a logical value indicating whether to return the value as a scalar if there is just one single value and not a list of values.

Value

Either a scalar value or a list of values, or the value of default if the CSS rule set does not have a declaration for the specified property.

Author(s)

Duncan Temple Lang

See Also

readCSS asCSSObject

Examples

1
2
  css = readCSS( system.file("samples", "OmegaTech.css", package = "RCSS"))
  sapply(css, getDeclaration, "color", NA)

omegahat/RCSS documentation built on May 24, 2019, 1:52 p.m.