StyleSheet: CSS style sheet builder

Description Usage Methods Examples

Description

CSS style sheet builder

Usage

1
2
3
4
5
6
7
8
sheet <- StyleSheet$new()
sheet <- css_stylesheet()

sheet$append(style)
sheet$remove(3)
sheet$add('h1', color = 'blue')
sheet$as_character()
new_sheet <- sheet$copy()

Methods

$new(...)

Initialise a stylesheet

... all arguments treated as Style objects and added to the style sheet
$append(...)

Append Style objects to this StyleSheet

... all arguments treated as Style objects and added to the style sheet
$remove(indices)

Remove Style objects from this StyleSheet by index.

indices indices of Style objects to remove
$add(..., selector = NULL)

Creates a Style object and adds it to the StyleSheet. Returns the newly created Style.

... name/value properties
selector If given, then used as the the selector for this style. If not given, then the first unnamed argument in ... is interpreted as the character string for the selector.
$as_character()

Convert StyleSheet to a character string.

$print()

Print StyleSheet to terminal.

$copy()

Copy StyleSheet.

Examples

1
2
3
4
5
6
7
8
## Not run: 
marsha <- css_style('#marsha')$
  update(marsha = 'marsha')$
  update(ptag$display$none, width = "100%")

sheet <- StyleSheet$new(marsha)

## End(Not run)

coolbutuseless/minicss documentation built on Nov. 4, 2019, 9:13 a.m.