tree.scss 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. @import "mixins/mixins";
  2. @import "common/var";
  3. @include b(tree) {
  4. cursor: default;
  5. background: $--color-white;
  6. color: $--tree-text-color;
  7. @include e(empty-block) {
  8. position: relative;
  9. min-height: 60px;
  10. text-align: center;
  11. width: 100%;
  12. height: 100%;
  13. }
  14. @include e(empty-text) {
  15. position: absolute;
  16. left: 50%;
  17. top: 50%;
  18. transform: translate(-50%, -50%);
  19. color: mix($--color-primary, rgb(158, 68, 0), 50%);
  20. }
  21. }
  22. @include b(tree-node) {
  23. white-space: nowrap;
  24. outline: none;
  25. &:focus { /* focus */
  26. > .el-tree-node__content {
  27. background-color: $--tree-node-hover-color;
  28. }
  29. }
  30. @include e(content) {
  31. display: flex;
  32. align-items: center;
  33. height: 26px;
  34. cursor: pointer;
  35. & > .el-tree-node__expand-icon {
  36. padding: 6px;
  37. }
  38. & > .el-checkbox {
  39. margin-right: 8px;
  40. }
  41. &:hover {
  42. background-color: $--tree-node-hover-color;
  43. }
  44. }
  45. @include e(expand-icon) {
  46. cursor: pointer;
  47. color: $--tree-expand-icon-color;
  48. font-size: 12px;
  49. transform: rotate(0deg);
  50. transition: transform 0.3s ease-in-out;
  51. &.expanded {
  52. transform: rotate(90deg);
  53. }
  54. &.is-leaf {
  55. color: transparent;
  56. cursor: default;
  57. }
  58. }
  59. @include e(label) {
  60. font-size: $--font-size-base;
  61. }
  62. @include e(loading-icon) {
  63. margin-right: 8px;
  64. font-size: $--font-size-base;
  65. color: $--tree-expand-icon-color;
  66. }
  67. & > .el-tree-node__children {
  68. overflow: hidden;
  69. background-color: transparent;
  70. }
  71. &.is-expanded > .el-tree-node__children {
  72. display: block;
  73. }
  74. }
  75. .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
  76. background-color: mix($--color-white, $--color-primary, 92%);
  77. }