Search code examples
rr-markdownxaringan

custom.css disappears when using Xaringan


I'm new in this fabulous Xaringan's world, so sorry if my question is too simple. I've found this question about changing the bullet point colors and I tried to replicate it.

I've created the custom.css file and stored it in remark-css folder but, every time I run the .rmd, the custom.css file disappears and I don't get the expected results, what am I doing wrong?


Solution

  • I was able to replicate as follows. New to R so had to do some setup.

    • Install R and R tools
    • Install R Studio
    • Install xaringan package

    In R Studio (testing.rmd)

    • File > New File > R Markdown > From Template > Ninja Presentation
    • Delete all the slides and created my own slide

    testing.rmd

    ---
    title: "Hello World"
    subtitle: "testing"
    author: "Hassan Voyeau"
    institute: "TTR"
    date: "19/9/2019 (updated: `r Sys.Date()`)"
    output:
      xaringan::moon_reader:
        css: ["default", "custom.css"]
        lib_dir: libs
        nature:
          highlightStyle: github
          highlightLines: true
          countIncrementalSlides: false
    ---
    
    HELLO WORLD
    
    * Item 1
    * Item 2
    

    custom.css (in the same folder as testing.rmd)

    ul {
        list-style: none;
    }
    
    ul li::before {
        content: "\2022";
        color: red;
        font-weight: bold;
        display: inline-block;
        width: 1em;
        margin-left: -1em;
    }
    

    And the results

    testing