|
| 1 | +@import '../../styles-var/devui-var'; |
| 2 | + |
| 3 | +.#{$devui-prefix}-collapse { |
| 4 | + font-size: $devui-font-size; |
| 5 | + background: $devui-base-bg; |
| 6 | + width: 100%; |
| 7 | + overflow-y: auto; |
| 8 | +} |
| 9 | + |
| 10 | +:host { |
| 11 | + display: block; |
| 12 | +} |
| 13 | + |
| 14 | +.#{$devui-prefix}-collapse__item { |
| 15 | + .#{$devui-prefix}-collapse--overflow-ellipsis { |
| 16 | + overflow: hidden; |
| 17 | + white-space: nowrap; |
| 18 | + text-overflow: ellipsis; |
| 19 | + } |
| 20 | +} |
| 21 | +.#{$devui-prefix}-collapse__item-title { |
| 22 | + display: block; |
| 23 | + height: 40px; |
| 24 | + width: 100%; |
| 25 | + padding: 0 28px 0 8px; |
| 26 | + font-weight: 400; |
| 27 | + line-height: 40px; |
| 28 | + color: $devui-text-weak; |
| 29 | + background: transparent; |
| 30 | + cursor: pointer; |
| 31 | + |
| 32 | + &.#{$devui-prefix}-collapse--disabled { |
| 33 | + color: $devui-disabled-text; |
| 34 | + cursor: not-allowed; |
| 35 | + } |
| 36 | + |
| 37 | + &:not(.#{$devui-prefix}-collapse--disabled) { |
| 38 | + &:hover { |
| 39 | + background: $devui-list-item-hover-bg; |
| 40 | + color: $devui-list-item-hover-text; |
| 41 | + } |
| 42 | + |
| 43 | + &.#{$devui-prefix}-collapse--router-active, |
| 44 | + &.#{$devui-prefix}-collapse--active:not(.#{$devui-prefix}-collapse--open) { |
| 45 | + color: $devui-brand-active; |
| 46 | + font-weight: bold; |
| 47 | + } |
| 48 | + } |
| 49 | +} |
| 50 | + |
| 51 | +/* 展开图标相关 */ |
| 52 | +.#{$devui-prefix}-collapse__item > .#{$devui-prefix}-collapse__item-title { |
| 53 | + position: relative; |
| 54 | + |
| 55 | + & > .#{$devui-prefix}-collapse__open-icon { |
| 56 | + display: inline-block; |
| 57 | + text-indent: 0; |
| 58 | + pointer-events: none; /* 让鼠标穿透 */ |
| 59 | + position: absolute; |
| 60 | + right: 6px; |
| 61 | + top: 12px; |
| 62 | + width: 16px; |
| 63 | + height: 16px; |
| 64 | + line-height: 16px; |
| 65 | + transition: transform ease-out 0.3s; |
| 66 | + } |
| 67 | + |
| 68 | + &.#{$devui-prefix}-collapse--open > .#{$devui-prefix}-collapse__open-icon { |
| 69 | + transform: rotate(180deg); |
| 70 | + transform-origin: center; |
| 71 | + } |
| 72 | +} |
| 73 | + |
| 74 | +/* 展开内容相关 */ |
| 75 | +.#{$devui-prefix}-collapse__item-content { |
| 76 | + padding: 0 28px 20px 8px; |
| 77 | +} |
0 commit comments