2022-05-23 10:58:30 +08:00
|
|
|
import type { MenuToken } from '.';
|
2022-06-27 14:25:59 +08:00
|
|
|
import type { GenerateStyle } from '../../theme';
|
2022-05-23 10:58:30 +08:00
|
|
|
|
|
|
|
const getRTLStyle: GenerateStyle<MenuToken> = ({ componentCls, menuArrowOffset }) => ({
|
|
|
|
[`${componentCls}-rtl`]: {
|
|
|
|
direction: 'rtl',
|
|
|
|
},
|
|
|
|
|
|
|
|
[`${componentCls}-submenu-rtl`]: {
|
|
|
|
transformOrigin: '100% 0',
|
|
|
|
},
|
|
|
|
|
|
|
|
// Vertical Arrow
|
|
|
|
[`${componentCls}-rtl${componentCls}-vertical,
|
|
|
|
${componentCls}-submenu-rtl ${componentCls}-vertical`]: {
|
|
|
|
[`${componentCls}-submenu-arrow`]: {
|
|
|
|
'&::before': {
|
|
|
|
transform: `rotate(-45deg) translateY(-${menuArrowOffset})`,
|
|
|
|
},
|
|
|
|
|
|
|
|
'&::after': {
|
|
|
|
transform: `rotate(45deg) translateY(${menuArrowOffset})`,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
export default getRTLStyle;
|