2022-05-23 10:58:30 +08:00
|
|
|
import type { MenuToken } from '.';
|
2022-11-23 20:22:38 +08:00
|
|
|
import type { GenerateStyle } from '../../theme/internal';
|
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;
|