stylesprismjsdocsify

How to modify font-size for docsify prismjs code blocks?


Docsify uses prismjs to syntax highlighting. I have tried to insert styles in the index.html but nothing is taking effect (I can modify the font-size with effect in chrome dev tools)

Have tried something like this.

  <style>
    code[class="lang-python"] {
        font-size: 0.5rem;
    }
  </style>
</head>

See here for the docsify doc of syntax highlighting. I think this should just be direct itnerfacing with prismjs unless docsify is doing something else there.

https://docsify.js.org/#/language-highlight?id=language-highlighting


Solution

  • you can use

      <style>
        code[class="lang-python"] {
            font-size: 0.5rem !important;
        }
      </style>