Files
api/web/utils/tailwind-rem-to-rem/index.ts
T
2024-10-02 16:02:01 -04:00

21 lines
607 B
TypeScript

import { scaleRemFactor } from "./utils";
import defaultTheme from "tailwindcss/defaultTheme";
import plugin from "tailwindcss/plugin";
export default plugin.withOptions(
() => {
return function () {
// Plugin functionality can be added here if needed in the future
};
},
// @ts-expect-error Invalid index signature
(options: { baseFontSize?: number; newFontSize?: number }) => {
const baseFontSize = options?.baseFontSize ?? 16;
const newFontSize = options?.newFontSize ?? 10;
return {
theme: scaleRemFactor(defaultTheme, baseFontSize, newFontSize),
};
}
);