@oiij/naive-ui
Version:
Some Composable Functions And Components for Vue 3
20 lines (18 loc) • 808 B
JavaScript
import { cssr, namespace, plugin } from "../_utils/cssr-bem.js";
//#region src/components/transition/transition.cssr.ts
const { c } = cssr;
const { cB } = plugin;
const cName = `${namespace}-transition`;
function fadeTransition({ name = "fade", enterDuration = ".3s", leaveDuration = ".3s", enterCubicBezier = "cubic-bezier(.4, 0, .2, 1)", leaveCubicBezier = "cubic-bezier(.4, 0, .2, 1)" } = {}) {
return [
cB(`${name}-enter-active`, { transition: `all ${enterDuration} ${enterCubicBezier}!important` }),
cB(`${name}-leave-active`, { transition: `all ${leaveDuration} ${leaveCubicBezier}!important` }),
cB(`${name}-enter-from`, { opacity: 0 }),
cB(`${name}-leave-to`, { opacity: 0 })
];
}
function transitionCssr() {
return c([fadeTransition()]);
}
//#endregion
export { cName, transitionCssr };