Customization and branding
Slides
Open slides in new window Download PDF of slides
Exercises
Themes
- Go to bootswatch.com and explore the different themes there (use the top navigation bar).
- Preview your site, then try changing different Bootswatch themes in
_quarto.yml.
CSS and Sass
- Preview your site
- Use the browser inspector to select a heading
- Create a CSS style that targets that heading and makes it
- red (
color) and - italic (
font-style) and - 30px (
font-size)
- red (
- Bonus: Those in-browser edits will disappear if you refresh the page. See if you can figure out how to put them in your website. (Hint!)
Create a SCSS file and make a bunch of rules!
Branding
_brand.yml tinkering
There is a file named
urban_institute.yml. Make a copy of it, rename it to_brand.yml, and rerender your site. What changes?Modify some of the variables in the
_brand.ymlfile and rerender to see how your site changes. Explore the brand.yml documentation and see what other settings you can adjust.You can reset the file by copying and pasting it from here.
theme_brand_ggplot()
In the first code chunk of
01-exercise.qmd, replacetheme_minimal()withtheme_brand_ggplot2(). You will need to supply a brand file path ("_brand.yml").Re-render and see what changes.
Change the
foregroundandbackgroundcolors in_brand.ymland rerun the code to create the plot. What changes?
read_brand_yaml() tinkering
In
01-exercise.qmd, read in_brand.ymlwithread_brand_yml()from the {brand.yml} package. Store it as a variable namedbrand.Change the color of the points to the brand’s
bluecolor and the line to the brand’smagentacolor. You’ll use code that looks something like this:geom_line(color = brand$color$palette$black)Bonus task! Map a variable from the dataset to the color aesthetic and change the legend to use colors from the brand.
_brand.yml
Create a brand file for yourself, your project, or your organization.
Don’t try to do this from scratch! Use these resources: