_table.scss 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. .ui-table {
  2. background-color: var(--ui-BG);
  3. max-width: 100%;
  4. display: table;
  5. &.table-full {
  6. width: 100%;
  7. }
  8. &.table-radius {
  9. border-radius: $radius;
  10. .ui-table-header {
  11. .ui-table-tr {
  12. border-top-left-radius: $radius;
  13. border-top-right-radius: $radius;
  14. }
  15. .ui-table-th {
  16. &:first-child {
  17. border-top-left-radius: $radius;
  18. }
  19. &:last-child {
  20. border-top-right-radius: $radius;
  21. }
  22. }
  23. }
  24. }
  25. .ui-table-header {
  26. display: table-header-group;
  27. .ui-table-th {
  28. font-weight: bold;
  29. border-bottom: 1px solid var(--ui-Border);
  30. white-space: nowrap;
  31. padding: 1em 0.8em;
  32. }
  33. }
  34. .ui-table-tr {
  35. display: table-row;
  36. z-index: 1;
  37. }
  38. .ui-table-body {
  39. display: table-row-group;
  40. position: relative;
  41. .ui-table-tr:hover {
  42. background-color: var(--ui-BG-1) !important;
  43. }
  44. .ui-table-loading {
  45. min-height: 300px;
  46. position: absolute !important;
  47. width: 100%;
  48. height: 100%;
  49. z-index: 2;
  50. display: flex;
  51. align-items: center;
  52. justify-content: center;
  53. border: 1px solid var(--ui-Border);
  54. }
  55. }
  56. .ui-table-td,
  57. .ui-table-th {
  58. display: table-cell;
  59. text-align: unset;
  60. padding: 0.5em 0.8em;
  61. // font-size: 90%;
  62. vertical-align: middle;
  63. }
  64. }
  65. .ui-table.table-border {
  66. &,
  67. & .ui-table-td,
  68. & .ui-table-th {
  69. position: relative;
  70. &::after {
  71. content: ' ';
  72. width: 200%;
  73. height: 200%;
  74. position: absolute;
  75. top: 0;
  76. left: 0;
  77. border-radius: inherit;
  78. transform: scale(0.5);
  79. transform-origin: 0 0;
  80. pointer-events: none;
  81. box-sizing: border-box;
  82. border: 1px solid var(--ui-Border);
  83. z-index: 1;
  84. }
  85. }
  86. .ui-table-td,
  87. .ui-table-th {
  88. &::after {
  89. border-width: 1px 1px 0 0;
  90. }
  91. &:last-child::after {
  92. border-right: none;
  93. }
  94. }
  95. }
  96. .ui-table.table-radius {
  97. &::after {
  98. border-radius: calc(#{$radius} * 2);
  99. }
  100. & .ui-table-tr .ui-table-th:first-child {
  101. border-top-left-radius: calc(#{$radius} * 2);
  102. }
  103. & .ui-table-tr .ui-table-th:last-child {
  104. border-top-right-radius: calc(#{$radius} * 2);
  105. }
  106. & .ui-table-tr:last-child .ui-table-td:first-child {
  107. border-bottom-left-radius: #{$radius};
  108. }
  109. & .ui-table-tr:last-child .ui-table-td:last-child {
  110. border-bottom-right-radius: #{$radius};
  111. }
  112. }
  113. .ui-table.table-striped > .ui-table-body > .ui-table-tr:nth-child(2n + 1),
  114. .ui-table.table-striped > .ui-table-body > .ui-table-tr:nth-child(2n + 1) {
  115. background-color: var(--ui-BG-1);
  116. }
  117. .table-responsive {
  118. width: inherit;
  119. height: 100%;
  120. max-width: 100%;
  121. overflow: hidden;
  122. box-sizing: border-box;
  123. .table-responsive-box {
  124. position: relative;
  125. overflow: hidden;
  126. }
  127. }