UNPKG

@vulppi/tailwindcss

Version:

A collection of plugins for TailwindCSS.

43 lines (40 loc) 1.07 kB
// node_modules/tailwindcss/dist/plugin.mjs function u(n, i) { return { handler: n, config: i }; } u.withOptions = function(n, i = () => ({})) { function t(o) { return { handler: n(o), config: i(o) }; } return t.__isOptionsFunction = true, t; }; var g = u; // src/utils/comment.ts function isRem(str) { return /^[0-9]+rem$/.test(str); } function parseRemToPx(str) { const remValue = parseFloat(str.replace(/rem$/, "")); return `${remValue * 16}px`; } function createPxComment(str) { if (isRem(str)) return ` /* ${parseRemToPx(str)} */`; return ""; } // src/gradient-extend.ts var extendGradientPosition = g(function({ matchUtilities, theme }) { matchUtilities({ "to-pos": (value) => ({ "--tw-gradient-to-position": value + createPxComment(value) }), "from-pos": (value) => ({ "--tw-gradient-from-position": value + createPxComment(value) }) }, { values: theme("width") }); }); var gradient_extend_default = extendGradientPosition; export { extendGradientPosition, gradient_extend_default as default };