I used a custom CSS style for my R markdown HTML output. I expected the output to simply insert the CSS file contents in the head of the HTML file, but the CSS was modified.
For example, the CSS embedded some external fonts with @import url(...) and those were embedded directly into the document with data URIs (src: url(data:font/ttf;base64,...). Similar behavior applies to external JavaScript files. Something like Google Analytics is transformed from a few lines that load an external script to embedding the whole script on a page. I may be satisfied with the behavior (no external dependencies in the HTML file), but maybe I wanted to keep my file as small as possible.
The closest to an explanation can be found in the bookdown book, where it says: "to provide all of the styles for the document from your own CSS you set the theme (and potentially highlight) to null". My theme and highlight are set to null.
Is there a way to control how the CSS gets parsed?