antd
Version:
An enterprise-class UI design language and React components implementation
33 lines • 1.12 kB
JavaScript
import { genComponentStyleHook } from '../../theme/internal';
import { genCssVar } from '../../theme/util/genStyleUtils';
const genWaveStyle = token => {
const {
componentCls,
colorPrimary,
antCls
} = token;
const [, varRef] = genCssVar(antCls, 'wave');
return {
[componentCls]: {
position: 'absolute',
background: 'transparent',
pointerEvents: 'none',
boxSizing: 'border-box',
color: varRef('color', colorPrimary),
boxShadow: `0 0 0 0 currentcolor`,
opacity: 0.2,
// =================== Motion ===================
'&.wave-motion-appear': {
transition: [`box-shadow 0.4s ${token.motionEaseOutCirc}`, `opacity 2s ${token.motionEaseOutCirc}`].join(','),
'&-active': {
boxShadow: `0 0 0 6px currentcolor`,
opacity: 0
},
'&.wave-quick': {
transition: [`box-shadow ${token.motionDurationSlow} ${token.motionEaseInOut}`, `opacity ${token.motionDurationSlow} ${token.motionEaseInOut}`].join(',')
}
}
}
};
};
export default genComponentStyleHook('Wave', genWaveStyle);