knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(minicss)
Selectors are descriptions of HTML entities on a page. Combined with a list of property/value pairs, they define which elements a particular style applies to.
Selectors may just be given as a character string, but you can also use the Selector
R6 class to help build selectors with a
more complex specification.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # All things with id = 'greg' with class = 'brady' #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ myselector <- Selector$new() myselector$class('brady') myselector$id('greg') myselector
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # All 'cindy' IDs which are children of 'carol' classes, and 'bobby' IDs which # are the last child of 'mike' classes #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ parent1 <- css_sel(".carol")$ parent_of('#cindy') parent2 <- css_sel()$ class('mike')$ attr(job = 'architect')$ parent_of( css_sel()$id('bobby')$pseudo_class(last_child = TRUE) ) parent1$and(parent2) parent1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.