mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
parent
f5d5e9b5ee
commit
2430ae2732
@ -57,9 +57,10 @@ export default class ColorPicker extends Component<ColorPickerProps> {
|
||||
render() {
|
||||
const { small, position, presetColors } = this.props;
|
||||
const { color, displayColorPicker } = this.state;
|
||||
const width = small ? 80 : 120;
|
||||
const styles = {
|
||||
color: {
|
||||
width: small ? '80px' : '120px',
|
||||
width: `${width}px`,
|
||||
height: small ? '16px' : '24px',
|
||||
borderRadius: '2px',
|
||||
background: color,
|
||||
@ -90,7 +91,7 @@ export default class ColorPicker extends Component<ColorPickerProps> {
|
||||
};
|
||||
|
||||
if (position === 'top') {
|
||||
styles.wrapper.transform = 'translateY(-100%)';
|
||||
styles.wrapper.transform = `translate(calc(-100% + ${width + 8}px), -100%)`;
|
||||
styles.wrapper.paddingBottom = 8;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user