ant-design/components/menu/style/rtl.tsx
MadCcc 5d9cb2e50d
refactor: Optimize theme export and add docs (#38902)
* refactor: Optimize theme export and add docs

* chore: fix lint

* chore: fix lint

* chore: fix lint
2022-11-23 20:22:38 +08:00

29 lines
728 B
TypeScript

import type { MenuToken } from '.';
import type { GenerateStyle } from '../../theme/internal';
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;