Content Classes

css content classes

Use css to create content classes to style elements

Emil Hvitfeldt true
05-20-2021

Custom content classes are a great way to quick style elements of your slides. Create a css class, here is a class called .orange which sets the color to orange.

If you write .orange[some text] then it will be rendered as some text in the final document.

Result

Rmd

---
output:
  xaringan::moon_reader:
    css: ["default", "stylesheet.css"]
    lib_dir: libs
    seal: FALSE
    nature:
      highlightStyle: github
      highlightLines: true
      countIncrementalSlides: false
---

# Sample .orange[Header]

.bold[Duis vel viverra elit, eget hendrerit odio.] 
Curabitur cursus elit nec diam vulputate, nec 
sollicitudin nunc ornare. Ut mi lectus, aliquet 
non ligula sed, lobortis vehicula erat. Morbi 
porttitor orci ut semper dapibus. Donec sodales 
tellus varius tortor varius, ornare commodo augue 
maximus. Vestibulum quisbibendum mi, sit amet 
lobortis leo. Morbi vulputate orci arcu, ac lobortis
sapien gravida eget. Nulla noninterdum orci, nec 
congue ligula.

stylesheet.css

.bold {
  font-weight: bold;
}

.orange {
  color: orange;
}

Reuse

Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".

Citation

For attribution, please cite this work as

Hvitfeldt (2021, May 20). Xaringan Gallery: Content Classes. Retrieved from https://xaringan.gallery/examples/content-classes/

BibTeX citation

@misc{hvitfeldt2021content,
  author = {Hvitfeldt, Emil},
  title = {Xaringan Gallery: Content Classes},
  url = {https://xaringan.gallery/examples/content-classes/},
  year = {2021}
}