Gathering detailed insights and metrics for tailwindcss-semantic-typography
Gathering detailed insights and metrics for tailwindcss-semantic-typography
npm install tailwindcss-semantic-typography
Typescript
Module System
Node Version
NPM Version
70.5
Supply Chain
98.3
Quality
89.4
Maintenance
100
Vulnerability
100
License
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
4,396
Last Day
1
Last Week
131
Last Month
172
Last Year
1,946
Minified
Minified + Gzipped
Latest Version
0.10.1
Package Id
tailwindcss-semantic-typography@0.10.1
Unpacked Size
41.31 kB
Size
14.04 kB
File Count
9
NPM Version
10.8.2
Node Version
20.18.2
Published on
Feb 09, 2025
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
627.8%
131
Compared to previous week
Last Month
83%
172
Compared to previous month
Last Year
-6.5%
1,946
Compared to previous year
1
1
This plug-in provides out-of-the-box typography settings based on semantic HTML tags for tailwindcss. See below in what ways it differs from the official typography plug-in.
NOTE: this plug-in is in an early alpha stage, but still useful and usable.
Install it from npm:
# Using npm
npm install -D tailwindcss-semantic-typography
# Using Yarn
yarn add tailwindcss-semantic-typography
Add it to your tailwindcss setup. For the time being, there are no means to configure the plug-in. Before 1.0 there will be an option to choose the type of font pairing or font setup you would like to use. Currently only a serif / sans scheme is supported.
// tailwind.config.js
module.exports = {
theme: {
// ...
},
plugins: [
require('tailwindcss-semantic-typography'),
// ...
],
};
Quite simple: use semantic tags correctly. Do not abuse semantic tags in the
navigational parts of your layouts. Put the content where you want typography
to be styled into an article
tag and everything else outside.
You might want to use the
structural example in the HTML5 specification
as a starting point.
If you want to generate readable line-lengths (65 characters), and some nice
default styling for lists (ol
and ul
) put your content
inside of an article
tag.
For the time being: choose your serif (headlines) and sans (body text) font pairing wisely.
That's all.
The official typography plug-in is built with a focus on content that is not known at build time (like content from a database or from remote sources). For this reason it installs as a full-fledged component and generates some overhead in the production CSS. Apart from that, it sticks with the "utility first" approach that tailwindcss propagates.
This plug-in is meant to combine the "utility first" approach with a global default for typography that builds on the semantic structure of HTML5. The presumption is that you use this plug-in in scenarios where you have full control over the content at build time, like you have with most modern static site builders like hugo.
On the one hand this allows for full-fledged optimization (you only have in production what you really need). On the other hand it enforces globally consistent typography for markup generated content (something you almost always want).
The settings are in line with the official typography plug-in, however you have to cater for colour elsewhere.
This plug-in builds on the following assumptions:
main
section that is present on every rendered pagesection
and article
tagsarticle
h1
, h2
,..., p
, pre
, code
,
in the navigational sections of your designNo vulnerabilities found.
No security vulnerabilities found.