A CSS stylesheet for Nimiq's typography. Inspired by the Tailwind CSS Typography plugin.
::: code-group
npm install nimiq-css
pnpm add nimiq-css
yarn add nimiq-css
:::
Now you can use the nq-prose
class to add sensible typography styles to any vanilla HTML:
<article class="nq-prose">
<h1>Your awesome content</h1>
<p>...</p>
</article>
If you have a block of markup embedded in some content that shouldn’t inherit the prose styles, use the raw
class to sandbox it:
<article class="nq-prose">
<h1>My Heading</h1>
<p>...</p>
<div class="nq-raw">
<!-- Some example or demo that needs to be prose-free -->
</div>
<p>...</p>
<!-- ... -->
</article>
Adding a dark
class to any preceding parent element will automatically adjust the typography styles to use colors that work well on dark backgrounds.
<body class="dark">
<article class="nq-prose">
<h1>Your awesome content</h1>
<p>...</p>
</article>
</body>
The CSS styles will not update the background color, you need to handle that yourself.
You can see a demo of the typography styles in the demo.md file.