mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-23 23:18:36 +08:00
502dac12aa
* docs: fix code * feat: lint * feat: prettier * feat: test * feat: review * feat: format html * feat: format html
36 lines
872 B
TypeScript
36 lines
872 B
TypeScript
import { unit } from '@ant-design/cssinjs';
|
|
import type { CssUtil } from 'antd-style';
|
|
|
|
import type { MenuToken } from '.';
|
|
import type { GenerateStyle } from '../../theme/internal';
|
|
|
|
const getRTLStyle: GenerateStyle<MenuToken & CssUtil> = ({
|
|
componentCls,
|
|
menuArrowOffset,
|
|
calc,
|
|
}) => ({
|
|
[`${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(${unit(calc(menuArrowOffset).mul(-1).equal())})`,
|
|
},
|
|
|
|
'&::after': {
|
|
transform: `rotate(45deg) translateY(${unit(menuArrowOffset)})`,
|
|
},
|
|
},
|
|
},
|
|
});
|
|
|
|
export default getRTLStyle;
|