Closed mohammadhosseinmoradi closed 9 months ago
Hi @mohammadhosseinmoradi, Do you mean when you set direction: rtl;
in CSS?
Hi, when set direction: rtl;
directly in html tag for whole document.
this change works great:
export default function originClassResolvers(placement: Placement | "center") {
switch (placement) {
case "top":
return "origin-bottom";
case "bottom":
return "origin-top";
case "left":
return "ltr:origin-right rtl:origin-left";
case "right":
return "ltr:origin-left rtl:origin-right";
case "top-start":
case "right-end":
return "ltr:origin-bottom-left rtl:origin-bottom-right";
case "top-end":
case "left-end":
return "ltr:origin-bottom-right rtl:origin-bottom-left";
case "right-start":
case "bottom-start":
return "ltr:origin-top-left rtl:origin-top-right";
case "left-start":
case "bottom-end":
return "ltr:origin-top-right rtl:origin-top-left";
default:
return "origin-center";
}
}
export const tailwindcssOriginSafelist = [
"origin-bottom",
"origin-top",
"ltr:origin-right rtl:origin-left",
"ltr:origin-left rtl:origin-right",
"ltr:origin-bottom-left rtl:origin-bottom-right",
"ltr:origin-bottom-right rtl:origin-bottom-left",
"ltr:origin-top-left rtl:origin-top-right",
"ltr:origin-top-right rtl:origin-top-left",
];
Thanks for report, I using above your code into the PR #82 and added your is co-author.
OriginClassResolver not properly works in rtl direction.