Configure tailwindcss-fluid-type
mainThe plugin is configured by passing an object to require("tailwindcss-fluid-type")() in your tailwind.config.js.
Important: When defining values, you must provide all necessary properties for a font size. The plugin does not perform value merging; if you define a custom value, it must be complete.
Settings Object
Used to define the global behavior of the fluid calculation:
fontSizeMin(number): The minimum font size (unitless, e.g.,1.125for1.125rem).fontSizeMax(number): The maximum font size.ratioMin(number): The minimum multiplier.ratioMax(number): The maximum multiplier.screenMin(number): The minimum viewport width (unitless, e.g.,20for20rem).screenMax(number): The maximum viewport width.unit(string): The unit to use, defaults to"rem". Can be"px".prefix(string): A string to prepend to generated classes (e.g.,"fluid-").extendValues(boolean): Iftrue, extends default Tailwind values. Iffalse, overwrites them. Defaults totrue(implied by context).
module.exports = {
plugins: [
require("tailwindcss-fluid-type")({
settings: {
fontSizeMin: 1.125,
fontSizeMax: 1.25,
ratioMin: 1.125,
ratioMax: 1.2,
screenMin: 20,
screenMax: 96,
unit: "rem",
prefix: "",
extendValues: true,
},
values: {
// ...
},
}),
],
};