@vulppi/tailwindcss
Version:
A collection of plugins for TailwindCSS.
52 lines (49 loc) • 1.41 kB
JavaScript
// 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/screen-rounded.ts
var roundedScreen = g(function({
matchUtilities,
theme
}) {
matchUtilities({
"v-rounded": (value) => ({
borderRadius: `max(0px, min(${value}, (100vw - 100% - 1px) * 9999))` + createPxComment(value),
"@media (pointer: fine)": {
borderRadius: `max(0px, min(${value}, (100vw - 100% - 11px) * 9999))` + createPxComment(value)
}
}),
"c-rounded": (value) => ({
borderRadius: `max(0px, min(${value}, (100cqw - 100% - 1px) * 9999))` + createPxComment(value),
"@media (pointer: fine)": {
borderRadius: `max(0px, min(${value}, (100cqw - 100% - 11px) * 9999))` + createPxComment(value)
}
})
}, { values: theme("borderRadius") });
});
var screen_rounded_default = roundedScreen;
export {
roundedScreen,
screen_rounded_default as default
};