# Define Base Colors ------------------------------------------------------
# Colors last updated on 2019-12-21
mayocolors <- list(
white = "#FFFFFF",
black = "#000000",
blue = "#0057B8",
brightblue = "#009CDE",
teal = "#9CDBD9",
green = "#00873E",
purple = "#8246AF",
red = "#E4002B",
orange = "#FE5000",
yellow = "#FFC845",
pearl = "#F1EAE5",
lightgrey = "#E6E6E6",
mediumgrey = "#D2D2D2",
darkgrey = "#A8A8A8",
nickel = "#8B8075",
bronze = "#A77040",
gold = "#AB9D62",
silver = "#A6A9AA"
)
# Write mayo_color_variables.css ------------------------------------------
css_colors <- paste0(" --mayo-", names(mayocolors), ": ", unname(unlist(mayocolors)), ";")
warning <-
"/*! This file is autogenerated in data/color_variables.css. Do not manually edit */
/*! =========================================================
@name color_variables.css
@description Mayo Clinic color variables
@lastUpdated December 21, 2019
============================================================= */
"
fileConn <- file("inst/resources/css/color_variables.css")
writeLines(c(warning, ":root {", css_colors, "}"), fileConn)
close(fileConn)
# usethis::use_data(mayocolors, overwrite = T)
#
# pal <- as.character(mayocolors)
# scales::show_col(pal)
# Generate SASS variables -------------------------------------------------
css_colors <- paste0("$mayo-", names(mayocolors), ": ", unname(unlist(mayocolors)), ";")
warning <- "// This file is autogenerated in data-raw/color_variables.css.
// Do not manually edit "
fileConn <- file("scss/_mayo_variables.scss")
writeLines(c(warning, css_colors), fileConn)
close(fileConn)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.