title: Exporting Markdown to PDF in Obsidian.md: How do I retain highlight colors in PDF?
body: <p>I'm using <code>Obsidian.md</code> and have created a css snippet that lets me utilize a combination of <code>**bold**</code>, <code>*italics*</code> and <code>==highlights==</code> to create three different colors; see image.</p>
  <p><strong>Markdown Colors</strong></p>
  <p><img src="https://i.stack.imgur.com/013ba.png" alt="Markdown Colors" /></p>
  <p>However, these colors are lost when I export the file to PDF, since the snippet doesn't govern that; I think it has to do with css printing, but I'm not sure. In the PDF it would look like this:
  <img src="https://i.stack.imgur.com/tWIGc.png" alt="PDF Colors" /></p>
  <p>Would anyone here be able to help me figure out, how to have the colors appear the same in markdown and in PDF?</p>
  <p>I'll share a part of the snippet below. This is for the red color, which is created by combining italics/asterisks and highlights/equal signs:</p>
  <pre class="lang-css prettyprint-override"><code>:root
  {
    --highlight-lred: #f0a6a6;
    --highlight-dred: #c08484;
  
  }
  
  /* Red Highlight */
  
  
  span.cm-em.cm-highlight {
      font-style: unset !important; 
      background-color: var(--highlight-red);
      color: #222;
  }
  
  body &gt; .app-container div.markdown-preview-view em &gt; mark {
      /*font-style: initial !important; */
      background-color: var(--highlight-red);
      color: #222;
  }
  </code></pre>