collapse.scss 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. @use 'mixins/mixins' as *;
  2. @use 'mixins/var' as *;
  3. @use 'common/var' as *;
  4. @use 'common/transition';
  5. @include b(collapse) {
  6. @include set-component-css-var('collapse', $collapse);
  7. border-top: 1px solid getCssVar('collapse-border-color');
  8. border-bottom: 1px solid getCssVar('collapse-border-color');
  9. }
  10. @include b(collapse-item) {
  11. @include when(disabled) {
  12. .#{$namespace}-collapse-item__header {
  13. color: getCssVar('text-color-disabled');
  14. cursor: not-allowed;
  15. }
  16. }
  17. @include e(header) {
  18. width: 100%;
  19. padding: 0;
  20. border: none;
  21. display: flex;
  22. align-items: center;
  23. height: getCssVar('collapse-header-height');
  24. line-height: getCssVar('collapse-header-height');
  25. background-color: getCssVar('collapse-header-bg-color');
  26. color: getCssVar('collapse-header-text-color');
  27. cursor: pointer;
  28. border-bottom: 1px solid getCssVar('collapse-border-color');
  29. font-size: getCssVar('collapse-header-font-size');
  30. font-weight: 500;
  31. transition: border-bottom-color getCssVar('transition-duration');
  32. outline: none;
  33. @include e(arrow) {
  34. transition: transform getCssVar('transition-duration');
  35. font-weight: 300;
  36. @include when(active) {
  37. transform: rotate(90deg);
  38. }
  39. }
  40. @include e(title) {
  41. text-align: left;
  42. flex: auto;
  43. }
  44. &.focusing:focus:not(:hover) {
  45. color: getCssVar('color-primary');
  46. }
  47. @include when(active) {
  48. border-bottom-color: transparent;
  49. }
  50. }
  51. @include e(wrap) {
  52. will-change: height;
  53. background-color: getCssVar('collapse-content-bg-color');
  54. overflow: hidden;
  55. box-sizing: border-box;
  56. border-bottom: 1px solid getCssVar('collapse-border-color');
  57. }
  58. @include e(content) {
  59. padding-bottom: 25px;
  60. font-size: getCssVar('collapse-content-font-size');
  61. color: getCssVar('collapse-content-text-color');
  62. line-height: 1.769230769230769;
  63. }
  64. &:last-child {
  65. margin-bottom: -1px;
  66. }
  67. }
  68. .#{$namespace}-collapse-icon-position {
  69. &-left {
  70. .#{$namespace}-collapse-item__ {
  71. &header {
  72. gap: 8px;
  73. }
  74. &title {
  75. order: 1;
  76. }
  77. }
  78. }
  79. &-right {
  80. .#{$namespace}-collapse-item__header {
  81. padding-right: 8px;
  82. }
  83. }
  84. }