_tables.scss 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. .table {
  2. thead {
  3. th {
  4. background: $table-th-bg;
  5. @include subheader;
  6. padding-top: $table-th-padding-y;
  7. padding-bottom: $table-th-padding-y;
  8. white-space: nowrap;
  9. @media print {
  10. background: transparent;
  11. }
  12. }
  13. }
  14. }
  15. .table-responsive {
  16. .table {
  17. margin-bottom: 0;
  18. }
  19. + .card-footer {
  20. border-top: 0;
  21. }
  22. }
  23. .table-transparent {
  24. thead {
  25. th {
  26. background: transparent;
  27. }
  28. }
  29. }
  30. .table-nowrap {
  31. > :not(caption) > * > * {
  32. white-space: nowrap;
  33. }
  34. }
  35. .table-vcenter {
  36. > :not(caption) > * > * {
  37. vertical-align: middle;
  38. }
  39. }
  40. .table-center {
  41. > :not(caption) > * > * {
  42. text-align: center;
  43. }
  44. }
  45. .td-truncate {
  46. max-width: 1px;
  47. width: 100%;
  48. }
  49. .table-mobile {
  50. @each $breakpoint, $breakpoint-max-widthin in $grid-breakpoints {
  51. &#{breakpoint-infix($breakpoint)} {
  52. @include media-breakpoint-down($breakpoint) {
  53. display: block;
  54. thead {
  55. display: none;
  56. }
  57. tbody,
  58. tr {
  59. display: flex;
  60. flex-direction: column;
  61. }
  62. td {
  63. display: block;
  64. padding: $table-cell-padding-x $table-cell-padding-y !important;
  65. border: none;
  66. color: var(--#{$prefix}body-color) !important;
  67. &[data-label] {
  68. &:before {
  69. @include subheader;
  70. content: attr(data-label);
  71. display: block;
  72. }
  73. }
  74. }
  75. tr {
  76. border-bottom: var(--#{$prefix}border-width)
  77. var(--#{$prefix}border-style) $table-border-color;
  78. }
  79. .btn {
  80. display: block;
  81. }
  82. }
  83. }
  84. }
  85. }
  86. /**
  87. Table sort
  88. */
  89. .table-sort {
  90. font: inherit;
  91. color: inherit;
  92. text-transform: inherit;
  93. letter-spacing: inherit;
  94. border: 0;
  95. background: inherit;
  96. display: block;
  97. width: 100%;
  98. text-align: inherit;
  99. @include transition(color $transition-time);
  100. margin: (-$table-th-padding-y) (-$table-th-padding-x);
  101. padding: $table-th-padding-y $table-th-padding-x;
  102. &:hover,
  103. &.asc,
  104. &.desc {
  105. color: var(--#{$prefix}body-color);
  106. }
  107. &:after {
  108. content: "";
  109. display: inline-flex;
  110. width: 1rem;
  111. height: 1rem;
  112. vertical-align: bottom;
  113. mask-image: $table-sort-bg-image;
  114. background: currentColor;
  115. margin-left: .25rem;
  116. }
  117. &.asc:after {
  118. mask-image: $table-sort-desc-bg-image;
  119. }
  120. &.desc:after {
  121. mask-image: $table-sort-asc-bg-image;
  122. }
  123. }
  124. .table-borderless {
  125. thead th {
  126. background: transparent;
  127. }
  128. }