css-modular-type weekly downloads statistics
By saurabhchardereal · npm · Tailwind plugins
A PostCSS and TailwindCSS plugin for generating modular type scales.
css-modular-type has 15 recorded weekly downloads on npm, an increase of 200% over the past 30 days, ranking #3054 of 3,247 tracked listings.
About css-modular-type
Warning
Still in beta. Report any issues if found.
Getting Started
Installation
# npm
npm install css-modular-type --save-dev
# or yarn
yarn add -D css-modular-type
# or pnpm
pnpm add -D css-modular-type
Usage
You can add this plugin as a PostCSS plugin inside your postcss.config.js:
// postcss.config.js
const postcss = require("css-modular-type/postcss");
// or just `require('css-modular-type)` as `postcss` is the default export;
// const postcss = require("css-modular-type")
module.exports = {
plugins: [postcss()],
};
Or as a TailwindCSS plugin by adding in your tailwind.config.js file:
module.exports = {
/* ... other tailwind styles ... */
theme: {},
plugins: [require("css-modular-type/tailwind")],
};
Input
:root {
/* css-modular-type-generate */
}
Output
:root {
--font-size--2: clamp(0.69rem, 0.01vw + 0.69rem, 0.70rem);
--font-size--1: clamp(0.83rem, 0.14vw + 0.81rem, 0.94rem);
--font-size-0: clamp(1.00rem, 0.33vw + 0.93rem, 1.25rem);
--font-size-1: clamp(1.20rem, 0.61vw + 1.08rem, 1.67rem);
--font-size-2: clamp(1.44rem, 1.03vw + 1.23rem, 2.22rem);
--font-size-3: clamp(1.73rem, 1.62vw + 1.40rem, 2.96rem);
--font-size-4: clamp(2.07rem, 2.46vw + 1.58rem, 3.95rem);
--font-size-5: clamp(2.49rem, 3.65vw + 1.76rem, 5.26rem)}
}
Configuration
The plugin comes with the following default configuration, but it is possible to customise pretty much all config options to your liking.
Default configuration
module.exports = {
plugins: [
require("css-modular-type")({
minScreenWidth: 320,
maxScreenWidth: 1536,
minFontSize: 16,
maxFontSize: 20,
minRatio: 1.2,
maxRatio: 1.333,
minStep: 2,
maxStep: 5,
precision: 2,
prefix: "font-size-" /* set to "fluid-" in tailwind plugin */,
rootFontSize: 16,
suffixType: "numbered" /* set to "values" in tailwind plugin */,
suffixValues: ["xs", "sm", "base", "md", "lg", "xl", "2xl", "3xl"],
unit: "rem",
replaceInline: false /* postcss plugin only */,
generatorDirective: "css-modular-type-generate" /* postcss plugin only */,
}),
],
};
Options
Note
Options marked as
(p)only applies topostcssplugin.
minScreenWidth
Type: number
Viewport width of your font's baseline step on minimum (mobile) screens widths.
maxScreenWidth
Type: number
Viewport width of your font's baseline step on maximum (desktop) screens widths.
minFontSize
Type: number
Minimum font size of your baseline step on minimum (mobile) screen widths. The base font size won't go below this size when the viewport is at minScreenWidth or below.
maxFontSize
Type: number
Maximum font size of your baseline step on maximum (desktop) screen widths. The base font size won't go above this size when the viewport is at maxScreenWidth or above.
minRatio | maxRatio
Type: number
Font scaling ratio for minimum/maximum screen width. Could be one of the ratio given below or a custom one.
1.067(Minor Second)1.125(Major Second)1.200(Minor Third)1.250(Major Third)1.333(Perfect Fourth)1.414(Augmented Fourth)1.500(Perfect Fifth)1.618(Golden Ratio)
minStep
Type: number
Minimum steps of font scales to produce (excluding your base font size on minimum screen width). So, if you set minStep to 2 and maxStep to 5, it'll generate 8 font scales variables i.e, minStep + maxStep + 1 (base font size).
maxStep
Type: number
Maximum steps of font scales to produce (excluding your base font size on maximum screen width). So, if you set minStep to 1 and maxStep to 3, it'll generate 5 font scales variables i.e, minStep + maxStep + 1 (base font size).
rootFontSize
Type: number
Root font size (default is usually 16px on all browsers). This is used to calculate rem values.
precision
Type: number
Precision of generated font values.
prefix
Type: string
Prefix of generated font variables.
suffixType
Type: "numbered" | "values"
Suffix to use for generated font scales. Could be one of:
-
numbered: Generated font variables will have the format of--${prefix}${number}. For example, with default configuration, it'll generate variables as:--font-size--1,--font-size-0,--font-size-2etc. -
values: Generated font variables will have the format of--${prefix}${suffixValues[<font-step>]}. For example, ifsuffixTypeis set tovalues, it'll generate variables with suffix fromsuffixValuesconfig option, like:--font-size-sm,--font-size-base,--font-size-md, etc.
suffixValues
Type: string[] | (defaultValues: string[]) => string[]
Array of suffix for each step in your type scale, in ascending order of font size. Will be used if suffixType is set to values.…
Description from the npm listing.
- css
- postcss
- postcss-plugin
- tailwind
- tailwindcss-plugin
- tailwindcss
- type
- typography
- fluid
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Tailwind plugins plugins
All 20 css-modular-type alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/css-modular-type. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.