@apexshift/tailwindcss-fluid-typography 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +4 -1
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -23,6 +23,7 @@ export default plugin.withOptions(
23
23
  // 1. Plugin implementation (runs when Tailwind processes CSS)
24
24
  function (options = {}) {
25
25
  return function ({ addUtilities, theme }) {
26
+
26
27
  // In development, log when plugin is actually executed
27
28
  if (process.env.NODE_ENV !== 'production') {
28
29
  console.log('[tailwindcss-fluid-typography] Plugin is running');
@@ -71,9 +72,11 @@ export default plugin.withOptions(
71
72
  const viewportRange = config.maxViewport - config.minViewport;
72
73
  const sizeRange = maxRem - minRem;
73
74
  const slope = sizeRange / viewportRange;
75
+ const slopeRounded = Number((slope * 100).toFixed(4));
74
76
  const intercept = minRem - slope * config.minViewport;
77
+ const interceptRounded = Number(intercept.toFixed(4));
75
78
 
76
- const preferred = `calc(${slope * 100}vw + ${intercept}rem)`;
79
+ const preferred = `calc(${slopeRounded}vw + ${interceptRounded}rem)`;
77
80
 
78
81
  utilities[`.text-${config.prefix}${key}`] = {
79
82
  'font-size': `clamp(${minRem}rem, ${preferred}, ${maxRem}rem)`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexshift/tailwindcss-fluid-typography",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Tailwind CSS plugin for automatic fluid typography using clamp()",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",