Syntax highlighting (prismjs) overridden by built in css

As documented (and also many blog posts elsewhere), I am adding something like this in Code Injection > Site Header:

<link rel="stylesheet" type="text/css" src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.24.1/themes/prism.min.css"/> -->
<!-- <link rel="stylesheet" type="text/css" src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.24.1/themes/prism-tomorrow.min.css"/>

and this in the Site Footer:

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.24.1/prism.min.js" integrity="sha512-axJX7DJduStuBB8ePC8ryGzacZPr3rdLaIDZitiEgWWk2gsXxEFlm4UW0iNzj2h3wp5mOylgHAzBzM4nRSvTZA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.24.1/components/prism-csharp.min.js" integrity="sha512-rt23WbuhlKUMRxGkKxQBE1kmIxImQNS67ljyevzs40iFvtKsLeJI/Pgq2FQAbrWWA4pnqZ/cKDjUdCGyRdHIug==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.24.1/components/prism-scala.min.js" integrity="sha512-5N2Dmc3slrmtb1FdIN9XAB77REuw3yYlHz0dbstcMWz0O8Cw+axKRpnFoWZXD78xp62wR9hz07yDitkVeMRQXQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.24.1/components/prism-java.min.js" integrity="sha512-prE8sqsXm1XwxSKT5BXnOvNd3/RDR3TwfiH/uEDD/yWmNa3uDRdeVTQDnCSvMKgr17+0P5PkM95xSP18bQ9rIg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.24.1/components/prism-javascript.min.js" integrity="sha512-3oavHcAYV/4pmn+iDuax6ru7dpjKnd+21+SzCQrYdTiYDncloL7QJ3qYvsA9JU0p7ZQjB+DizGeWMm2sUrCzSQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

However, the syntax highlighting provided by the theme overrides prismjs resulting in mix-mash of colors; esp. the background stays the default gray. I am trying to use dark mode theme for syntax highlighting.

Is this expected? If not, what am I doing wrong?

1 Like