resize.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const genResizeStyle = token => {
  2. const {
  3. componentCls
  4. } = token;
  5. return {
  6. [`${componentCls}-wrapper ${componentCls}-resize-handle`]: {
  7. position: 'absolute',
  8. top: 0,
  9. height: '100% !important',
  10. bottom: 0,
  11. left: ' auto !important',
  12. right: ' -8px',
  13. cursor: 'col-resize',
  14. touchAction: 'none',
  15. userSelect: 'auto',
  16. width: '16px',
  17. zIndex: 1,
  18. [`&-line`]: {
  19. display: 'block',
  20. width: '1px',
  21. marginLeft: '7px',
  22. height: '100% !important',
  23. backgroundColor: token.colorPrimary,
  24. opacity: 0
  25. },
  26. [`&:hover &-line`]: {
  27. opacity: 1
  28. }
  29. },
  30. [`${componentCls}-wrapper ${componentCls}-resize-handle.dragging`]: {
  31. overflow: 'hidden',
  32. [`${componentCls}-resize-handle-line`]: {
  33. opacity: 1
  34. },
  35. [`&:before`]: {
  36. position: 'absolute',
  37. top: 0,
  38. bottom: 0,
  39. content: '" "',
  40. width: '200vw',
  41. transform: 'translateX(-50%)',
  42. opacity: 0
  43. }
  44. }
  45. };
  46. };
  47. export default genResizeStyle;