Use a css code chunk to embed the CSS rules directly in your quarto document #1402
-
Is it possible to use a css code chunk to embed the CSS rules directly in your quarto document as in an rmarkdown document?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
With raw html cell:
|
Beta Was this translation helpful? Give feedback.
-
@ManuelSpinola yes any knitr feature will work with Quarto when you are knitr computation engine ---
format: html
---
```{css, echo = FALSE}
h1 {
color: red;
}
```
# Red header
Some content
```{r}
1 + 1
``` If you try without any R chunk inside the document, you need to explicitly configure the use of knitr engine
See about engine binding However, knitr will indeed write the same content from the chunk as @mcanouil answer - so directly writing raw block is a solution. For styling with Quarto, using the theme file stays the recommended way: https://quarto.org/docs/output-formats/html-themes.html#theme-options |
Beta Was this translation helpful? Give feedback.
@ManuelSpinola yes any knitr feature will work with Quarto when you are knitr computation engine
If you try without any R chunk inside the document, you need to explicitly configure the use of knitr engine
See about engine binding
However, knitr will indeed write the same content from the chunk as @mcanouil answer - so directly writing raw block is a solution.
For styling with Quarto, using the theme file stays the recommended way: https://quarto.org/docs/output-formats/html-themes.html#theme-options