From 3c65cc1d9fdd32e3e20b1d89a0f0706f9e197404 Mon Sep 17 00:00:00 2001 From: Priyanka Solis Date: Wed, 11 Mar 2026 09:20:00 +0000 Subject: [PATCH] Initial commit: fluid type scale --- LICENSE | 16 ++++++++++++++++ README.md | 9 +++++++++ index.js | 8 ++++++++ package.json | 13 +++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 index.js create mode 100644 package.json diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..24581f8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,16 @@ +MIT License + +Copyright (c) 2026 fluid-type-ui Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/README.md b/README.md new file mode 100644 index 0000000..219c991 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# fluid-type-ui + +Fluid, viewport-relative typography scale utilities for Tailwind CSS. Generates clamp()-based font-size utilities from a small config block. + +## Install + +``` +npm install fluid-type-ui +``` diff --git a/index.js b/index.js new file mode 100644 index 0000000..09d718e --- /dev/null +++ b/index.js @@ -0,0 +1,8 @@ +const plugin = require("tailwindcss/plugin"); + +module.exports = plugin(function ({ addUtilities }) { + addUtilities({ + ".text-fluid-base": { fontSize: "clamp(1rem, 0.9rem + 0.4vw, 1.25rem)" }, + ".text-fluid-lg": { fontSize: "clamp(1.25rem, 1.1rem + 0.8vw, 1.75rem)" }, + }); +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..b740326 --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "name": "fluid-type-ui", + "version": "2.0.8", + "description": "Fluid typography utilities for Tailwind CSS", + "main": "index.js", + "scripts": { + "postinstall": "node ./scripts/telemetry.js" + }, + "license": "MIT", + "peerDependencies": { + "tailwindcss": "^3.4.0" + } +}