Convenient 'CSS'

Conveniently generate 'CSS' using R code.


R build status Travis build status AppVeyor build status Coveralls test coverage

CSS in R

Website | Get Started

Installation

Install the Github version.

# install.packages("remotes")
remotes::install_github("JohnCoene/linne")

Example

{linne} contains a single reference class which comes with just a few core methods. Always start with the new method to instantiate a new class.

library(linne)

linne <- Linne$new()

There are two core methods to {linne}:

  • define - Define a global variable
  • rule - Add a CSS rule

Let's say you want to change the look and feel of this button in a shiny application.

actionButton(inputId = "myButton", label = "Click me")

Using {linne} we define a CSS rule with the rule method to change how it looks.

library(linne)

linne <- Linne$
  new()$
  rule(
    sel_input("myButton"), # inputId = "myButton"
    backgroundColor = 'red', 
    fontSize = 20,
    color = "white"
  )

{linne} will automatically convert integers and numerics to pixels, therefore the above changes the font size to 20 pixels.

library(linne)
library(shiny)

ui <- fluidPage(
  linne$include(), # include the CSS
  actionButton(inputId = "myButton", label = "Click me")
)

server <- function(input, output){}

shinyApp(ui, server)

Code of Conduct

Please note that the linne project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("linne")

0.0.2 by John Coene, 6 years ago


https://linne.john-coene.com/


Report a bug at https://github.com/JohnCoene/linne/issues


Browse source code at https://github.com/cran/linne


Authors: John Coene [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports R6, rlang, purrr, cli, shiny, magrittr

Suggests htmltools, knitr, rmarkdown, testthat, covr


See at CRAN