@apexshift/tailwindcss-fluid-typography 0.0.4 → 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.
- package/index.mjs +3 -7
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -23,12 +23,6 @@ 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
|
-
console.log('[FLUID] Raw options received:', JSON.stringify(options, null, 2));
|
|
27
|
-
console.log('[FLUID] Detected flat size keys:', Object.keys(options).filter(k => k.startsWith('size-')));
|
|
28
|
-
console.log('[FLUID] Final config.rootFontSize:', config.rootFontSize);
|
|
29
|
-
console.log('[FLUID] Final config.minViewport:', config.minViewport);
|
|
30
|
-
console.log('[FLUID] Final config.maxViewport:', config.maxViewport);
|
|
31
|
-
console.log('[FLUID] Final config.sizes.base:', config.sizes.base);
|
|
32
26
|
|
|
33
27
|
// In development, log when plugin is actually executed
|
|
34
28
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -78,9 +72,11 @@ export default plugin.withOptions(
|
|
|
78
72
|
const viewportRange = config.maxViewport - config.minViewport;
|
|
79
73
|
const sizeRange = maxRem - minRem;
|
|
80
74
|
const slope = sizeRange / viewportRange;
|
|
75
|
+
const slopeRounded = Number((slope * 100).toFixed(4));
|
|
81
76
|
const intercept = minRem - slope * config.minViewport;
|
|
77
|
+
const interceptRounded = Number(intercept.toFixed(4));
|
|
82
78
|
|
|
83
|
-
const preferred = `calc(${
|
|
79
|
+
const preferred = `calc(${slopeRounded}vw + ${interceptRounded}rem)`;
|
|
84
80
|
|
|
85
81
|
utilities[`.text-${config.prefix}${key}`] = {
|
|
86
82
|
'font-size': `clamp(${minRem}rem, ${preferred}, ${maxRem}rem)`,
|