Installations
npm install tailwindcss-typography
Developer Guide
Typescript
No
Module System
N/A
Node Version
14.2.0
NPM Version
6.14.5
Score
78.4
Supply Chain
100
Quality
75.5
Maintenance
100
Vulnerability
99.6
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
benface
Download Statistics
Total Downloads
406,615
Last Day
42
Last Week
1,581
Last Month
6,570
Last Year
56,758
GitHub Statistics
ISC License
244 Stars
50 Commits
5 Forks
4 Watchers
13 Branches
2 Contributors
Updated on Oct 04, 2024
Bundle Size
74.13 kB
Minified
25.90 kB
Minified + Gzipped
Package Meta Information
Latest Version
3.1.0
Package Id
tailwindcss-typography@3.1.0
Unpacked Size
68.79 kB
Size
10.45 kB
File Count
7
NPM Version
6.14.5
Node Version
14.2.0
Total Downloads
Cumulative downloads
Total Downloads
406,615
Last Day
-53.3%
42
Compared to previous day
Last Week
-4.6%
1,581
Compared to previous week
Last Month
27.2%
6,570
Compared to previous month
Last Year
-6.3%
56,758
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
1
Typography Plugin for Tailwind CSS
Requirements
This plugin requires Tailwind CSS 1.2 or later. If your project uses an older version of Tailwind, you should install the latest 2.x version of this plugin (npm install tailwindcss-typography@2.x
).
Installation
1npm install tailwindcss-typography
Usage
1// tailwind.config.js 2module.exports = { 3 theme: { 4 textIndent: { // defaults to {} 5 '1': '0.25rem', 6 '2': '0.5rem', 7 }, 8 textShadow: { // defaults to {} 9 'default': '0 2px 5px rgba(0, 0, 0, 0.5)', 10 'lg': '0 2px 10px rgba(0, 0, 0, 0.5)', 11 }, 12 textDecorationStyle: { // defaults to these values 13 'solid': 'solid', 14 'double': 'double', 15 'dotted': 'dotted', 16 'dashed': 'dashed', 17 'wavy': 'wavy', 18 }, 19 textDecorationColor: { // defaults to theme => theme('colors') 20 'red': '#f00', 21 'green': '#0f0', 22 'blue': '#00f', 23 }, 24 fontVariantCaps: { // defaults to these values 25 'normal': 'normal', 26 'small': 'small-caps', 27 'all-small': 'all-small-caps', 28 'petite': 'petite-caps', 29 'unicase': 'unicase', 30 'titling': 'titling-caps', 31 }, 32 fontVariantNumeric: { // defaults to these values 33 'normal': 'normal', 34 'ordinal': 'ordinal', 35 'slashed-zero': 'slashed-zero', 36 'lining': 'lining-nums', 37 'oldstyle': 'oldstyle-nums', 38 'proportional': 'proportional-nums', 39 'tabular': 'tabular-nums', 40 'diagonal-fractions': 'diagonal-fractions', 41 'stacked-fractions': 'stacked-fractions', 42 }, 43 fontVariantLigatures: { // defaults to these values 44 'normal': 'normal', 45 'none': 'none', 46 'common': 'common-ligatures', 47 'no-common': 'no-common-ligatures', 48 'discretionary': 'discretionary-ligatures', 49 'no-discretionary': 'no-discretionary-ligatures', 50 'historical': 'historical-ligatures', 51 'no-historical': 'no-historical-ligatures', 52 'contextual': 'contextual', 53 'no-contextual': 'no-contextual', 54 }, 55 textRendering: { // defaults to these values 56 'rendering-auto': 'auto', 57 'optimize-legibility': 'optimizeLegibility', 58 'optimize-speed': 'optimizeSpeed', 59 'geometric-precision': 'geometricPrecision' 60 }, 61 textStyles: theme => ({ // defaults to {} 62 heading: { 63 output: false, // this means there won't be a "heading" component in the CSS, but it can be extended 64 fontWeight: theme('fontWeight.bold'), 65 lineHeight: theme('lineHeight.tight'), 66 }, 67 h1: { 68 extends: 'heading', // this means all the styles in "heading" will be copied here; "extends" can also be an array to extend multiple text styles 69 fontSize: theme('fontSize.5xl'), 70 '@screen sm': { 71 fontSize: theme('fontSize.6xl'), 72 }, 73 }, 74 h2: { 75 extends: 'heading', 76 fontSize: theme('fontSize.4xl'), 77 '@screen sm': { 78 fontSize: theme('fontSize.5xl'), 79 }, 80 }, 81 h3: { 82 extends: 'heading', 83 fontSize: theme('fontSize.4xl'), 84 }, 85 h4: { 86 extends: 'heading', 87 fontSize: theme('fontSize.3xl'), 88 }, 89 h5: { 90 extends: 'heading', 91 fontSize: theme('fontSize.2xl'), 92 }, 93 h6: { 94 extends: 'heading', 95 fontSize: theme('fontSize.xl'), 96 }, 97 link: { 98 fontWeight: theme('fontWeight.bold'), 99 color: theme('colors.blue.400'), 100 '&:hover': { 101 color: theme('colors.blue.600'), 102 textDecoration: 'underline', 103 }, 104 }, 105 richText: { 106 fontWeight: theme('fontWeight.normal'), 107 fontSize: theme('fontSize.base'), 108 lineHeight: theme('lineHeight.relaxed'), 109 '> * + *': { 110 marginTop: '1em', 111 }, 112 'h1': { 113 extends: 'h1', 114 }, 115 'h2': { 116 extends: 'h2', 117 }, 118 'h3': { 119 extends: 'h3', 120 }, 121 'h4': { 122 extends: 'h4', 123 }, 124 'h5': { 125 extends: 'h5', 126 }, 127 'h6': { 128 extends: 'h6', 129 }, 130 'ul': { 131 listStyleType: 'disc', 132 }, 133 'ol': { 134 listStyleType: 'decimal', 135 }, 136 'a': { 137 extends: 'link', 138 }, 139 'b, strong': { 140 fontWeight: theme('fontWeight.bold'), 141 }, 142 'i, em': { 143 fontStyle: 'italic', 144 }, 145 }, 146 }), 147 }, 148 variants: { // all the following default to ['responsive'] 149 textIndent: ['responsive'], 150 textShadow: ['responsive'], 151 textDecorationStyle: ['responsive'], 152 textDecorationColor: ['responsive'], 153 ellipsis: ['responsive'], 154 hyphens: ['responsive'], 155 kerning: ['responsive'], 156 textUnset: ['responsive'], 157 fontVariantCaps: ['responsive'], 158 fontVariantNumeric: ['responsive'], 159 fontVariantLigatures: ['responsive'], 160 textRendering: ['responsive'], 161 }, 162 plugins: [ 163 require('tailwindcss-typography')({ 164 // all these options default to the values specified here 165 ellipsis: true, // whether to generate ellipsis utilities 166 hyphens: true, // whether to generate hyphenation utilities 167 kerning: true, // whether to generate kerning utilities 168 textUnset: true, // whether to generate utilities to unset text properties 169 componentPrefix: 'c-', // the prefix to use for text style classes 170 }), 171 ], 172};
This plugin generates the following utilities:
1/* configurable with the "textIndent" theme object */ 2.indent-[key] { 3 text-indent: [value]; 4} 5 6/* configurable with the "textShadow" theme object */ 7/* note: the "default" key generates a simple "text-shadow" class (instead of "text-shadow-default") */ 8.text-shadow-[key] { 9 text-shadow: [value]; 10} 11 12/* configurable with the "textDecorationStyle" theme object */ 13.line-[key] { 14 text-decoration-style: [value]; 15} 16 17/* configurable with the "textDecorationColor" theme object */ 18.line-[key] { 19 text-decoration-color: [value]; 20} 21 22/* generated when the "ellipsis" option is set to true */ 23.ellipsis { 24 text-overflow: ellipsis; 25} 26.no-ellipsis { 27 text-overflow: clip; 28} 29 30/* generated when the "hyphens" option is set to true */ 31.hyphens-none { 32 hyphens: none; 33} 34.hyphens-manual { 35 hyphens: manual; 36} 37.hyphens-auto { 38 hyphens: auto; 39} 40 41/* generated when the "kerning" option is set to true */ 42.kerning { 43 font-kerning: normal; 44} 45.kerning-none { 46 font-kerning: none; 47} 48.kerning-auto { 49 font-kerning: auto; 50} 51 52/* generated when the "textUnset" option is set to true */ 53.font-family-unset { 54 font-family: inherit; 55} 56.font-weight-unset { 57 font-weight: inherit; 58} 59.font-style-unset { 60 font-style: inherit; 61} 62.text-size-unset { 63 font-size: inherit; 64} 65.text-align-unset { 66 text-align: inherit; 67} 68.leading-unset { 69 line-height: inherit; 70} 71.tracking-unset { 72 letter-spacing: inherit; 73} 74.text-color-unset { 75 color: inherit; 76} 77.text-transform-unset { 78 text-transform: inherit; 79} 80 81/* configurable with the "fontVariantCaps" theme object */ 82.caps-normal { 83 font-variant-caps: normal; 84} 85.caps-small { 86 font-variant-caps: small-caps; 87} 88.caps-all-small { 89 font-variant-caps: all-small-caps; 90} 91.caps-petite { 92 font-variant-caps: petite-caps; 93} 94.caps-unicase { 95 font-variant-caps: unicase; 96} 97.caps-titling { 98 font-variant-caps: titling-caps; 99} 100 101/* configurable with the "fontVariantNumeric" theme object */ 102.nums-normal { 103 font-variant-numeric: normal; 104} 105.nums-ordinal { 106 font-variant-numeric: ordinal; 107} 108.nums-slashed-zero { 109 font-variant-numeric: slashed-zero; 110} 111.nums-lining { 112 font-variant-numeric: lining-nums; 113} 114.nums-oldstyle { 115 font-variant-numeric: oldstyle-nums; 116} 117.nums-proportional { 118 font-variant-numeric: proportional-nums; 119} 120.nums-tabular { 121 font-variant-numeric: tabular-nums; 122} 123.nums-diagonal-fractions { 124 font-variant-numeric: diagonal-fractions; 125} 126.nums-stacked-fractions { 127 font-variant-numeric: stacked-fractions; 128} 129 130/* configurable with the "fontVariantLigatures" theme object */ 131.ligatures-normal { 132 font-variant-ligatures: normal; 133} 134.ligatures-none { 135 font-variant-ligatures: none; 136} 137.ligatures-common { 138 font-variant-ligatures: common-ligatures; 139} 140.ligatures-no-common { 141 font-variant-ligatures: no-common-ligatures; 142} 143.ligatures-discretionary { 144 font-variant-ligatures: discretionary-ligatures; 145} 146.ligatures-no-discretionary { 147 font-variant-ligatures: no-discretionary-ligatures; 148} 149.ligatures-historical { 150 font-variant-ligatures: historical-ligatures; 151} 152.ligatures-no-historical { 153 font-variant-ligatures: no-historical-ligatures; 154} 155.ligatures-contextual { 156 font-variant-ligatures: contextual; 157} 158.ligatures-no-contextual { 159 font-variant-ligatures: no-contextual; 160} 161 162/* configurable with the "textRendering" theme object */ 163.text-rendering-auto { 164 text-rendering: auto; 165} 166.text-optimize-legibility { 167 text-rendering: optimizeLegibility; 168} 169.text-optimize-speed { 170 text-rendering: optimizeSpeed; 171} 172.text-geometric-precision { 173 text-rendering: geometricPrecision; 174}
The plugin also generates components for text styles. The above config example would generate something like this:
1.c-h1 { 2 font-weight: 700; 3 line-height: 1.25; 4 font-size: 3rem; 5} 6@media (min-width: 640px) { 7 .c-h1 { 8 font-size: 4rem; 9 } 10} 11.c-h2 { 12 font-weight: 800; 13 line-height: 1.25; 14 font-size: 2.25rem; 15} 16@media (min-width: 640px) { 17 .c-h2 { 18 font-size: 3rem; 19 } 20} 21.c-h3 { 22 font-weight: 700; 23 line-height: 1.25; 24 font-size: 2.25rem; 25} 26.c-h4 { 27 font-weight: 700; 28 line-height: 1.25; 29 font-size: 1.875rem; 30} 31.c-h5 { 32 font-weight: 700; 33 line-height: 1.25; 34 font-size: 1.5rem; 35} 36.c-h6 { 37 font-weight: 700; 38 line-height: 1.25; 39 font-size: 1.25rem; 40} 41 42.c-link { 43 font-weight: 700; 44 color: #63b3ed; 45} 46.c-link:hover { 47 color: #3182ce; 48 text-decoration: underline; 49} 50 51.c-rich-text { 52 font-weight: 400; 53 font-size: 1rem; 54 line-height: 1.625; 55} 56.c-rich-text > * + * { 57 margin-top: 1em; 58} 59.c-rich-text h1 { 60 font-weight: 700; 61 line-height: 1.25; 62 font-size: 3rem; 63} 64@media (min-width: 640px) { 65 .c-rich-text h1 { 66 font-size: 4rem; 67 } 68} 69.c-rich-text h2 { 70 font-weight: 800; 71 line-height: 1.25; 72 font-size: 2.25rem; 73} 74@media (min-width: 640px) { 75 .c-rich-text h2 { 76 font-size: 3rem; 77 } 78} 79.c-rich-text h3 { 80 font-weight: 700; 81 line-height: 1.25; 82 font-size: 2.25rem; 83} 84.c-rich-text h4 { 85 font-weight: 700; 86 line-height: 1.25; 87 font-size: 1.875rem; 88} 89.c-rich-text h5 { 90 font-weight: 700; 91 line-height: 1.25; 92 font-size: 1.5rem; 93} 94.c-rich-text h6 { 95 font-weight: 700; 96 line-height: 1.25; 97 font-size: 1.25rem; 98} 99.c-rich-text ul { 100 list-style-type: disc; 101} 102.c-rich-text ol { 103 list-style-type: decimal; 104} 105.c-rich-text a { 106 font-weight: 700; 107 color: #63b3ed; 108} 109.c-rich-text a:hover { 110 color: #3182ce; 111 text-decoration: underline; 112} 113.c-rich-text b, .c-rich-text strong { 114 font-weight: 700; 115} 116.c-rich-text i, .c-rich-text em { 117 font-style: italic; 118}
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE.md:0
- Info: FSF or OSI recognized license: ISC License: LICENSE.md:0
Reason
Found 2/28 approved changesets -- score normalized to 0
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 4 are checked with a SAST tool
Reason
47 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5
- Warn: Project is vulnerable to: GHSA-257v-vj4p-3w2h
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm
- Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r
- Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g
- Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p
- Warn: Project is vulnerable to: GHSA-px4h-xg32-q955
- Warn: Project is vulnerable to: GHSA-3j8f-xvm3-ffx4
- Warn: Project is vulnerable to: GHSA-4p35-cfcx-8653
- Warn: Project is vulnerable to: GHSA-7f3x-x4pr-wqhj
- Warn: Project is vulnerable to: GHSA-jpp7-7chh-cf67
- Warn: Project is vulnerable to: GHSA-q6wq-5p59-983w
- Warn: Project is vulnerable to: GHSA-j9fq-vwqv-2fm2
- Warn: Project is vulnerable to: GHSA-pqw5-jmp5-px4v
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-566m-qj78-rww5
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6
- Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj
- Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
Score
1.7
/10
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to tailwindcss-typography
@tailwindcss/typography
A Tailwind CSS plugin for automatically styling plain HTML content with beautiful typographic defaults.
@weapp-tailwindcss/typography
The tailwindcss typography plugin for weapp
tailwindcss-semantic-typography
Bring semantic typography to tailwindcss
dark-tailwindcss-typography
Precompiled @tailwindcss/typography with dark mode support