directory.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // ============================ Directory =============================
  2. export const genDirectoryStyle = ({
  3. treeCls,
  4. treeNodeCls,
  5. directoryNodeSelectedBg,
  6. directoryNodeSelectedColor,
  7. motionDurationMid,
  8. borderRadius,
  9. controlItemBgHover
  10. }) => ({
  11. [`${treeCls}${treeCls}-directory ${treeNodeCls}`]: {
  12. // >>> Title
  13. [`${treeCls}-node-content-wrapper`]: {
  14. position: 'static',
  15. [`&:has(${treeCls}-drop-indicator)`]: {
  16. position: 'relative'
  17. },
  18. [`> *:not(${treeCls}-drop-indicator)`]: {
  19. position: 'relative'
  20. },
  21. '&:hover': {
  22. background: 'transparent'
  23. },
  24. // Expand interactive area to whole line
  25. '&:before': {
  26. position: 'absolute',
  27. inset: 0,
  28. transition: `background-color ${motionDurationMid}`,
  29. content: '""',
  30. borderRadius
  31. },
  32. '&:hover:before': {
  33. background: controlItemBgHover
  34. }
  35. },
  36. [`${treeCls}-switcher, ${treeCls}-checkbox, ${treeCls}-draggable-icon`]: {
  37. zIndex: 1
  38. },
  39. // ============= Selected =============
  40. '&-selected': {
  41. background: directoryNodeSelectedBg,
  42. borderRadius,
  43. [`${treeCls}-switcher, ${treeCls}-draggable-icon`]: {
  44. color: directoryNodeSelectedColor
  45. },
  46. // >>> Title
  47. [`${treeCls}-node-content-wrapper`]: {
  48. color: directoryNodeSelectedColor,
  49. background: 'transparent',
  50. '&, &:hover': {
  51. color: directoryNodeSelectedColor
  52. },
  53. '&:before, &:hover:before': {
  54. background: directoryNodeSelectedBg
  55. }
  56. }
  57. }
  58. }
  59. });