_tables.scss 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. // BASIC
  2. // -----------------------------------------------------------------------------
  3. /* Tables - Basic */
  4. .table {
  5. width: 100%;
  6. .table {
  7. background: transparent;
  8. }
  9. }
  10. /* Bootstrap uses important, we need to force it here */
  11. .table.mb-none {
  12. margin-bottom: 0 !important;
  13. }
  14. /* In case you dont want a border in some row */
  15. .table .b-top-none td {
  16. border-top: none;
  17. }
  18. // ACTIONS
  19. // -----------------------------------------------------------------------------
  20. /* Tables - Actions */
  21. .table {
  22. .actions,
  23. .actions-hover {
  24. vertical-align: middle;
  25. a {
  26. display: inline-block;
  27. margin-right: 5px;
  28. color: #666;
  29. &:last-child {
  30. margin-right: 0;
  31. }
  32. }
  33. a:hover {
  34. color: #333;
  35. }
  36. }
  37. .actions-hover {
  38. a {
  39. opacity: 0;
  40. }
  41. }
  42. tr:hover {
  43. .actions-hover {
  44. a {
  45. opacity: 1;
  46. }
  47. }
  48. }
  49. .actions-fade {
  50. a {
  51. @include transition (all .2s linear);
  52. }
  53. }
  54. }
  55. // NO MORE TABLES
  56. // -----------------------------------------------------------------------------
  57. /* Tables - No More Tables technique (991px is the bootstrap SM max-width) */
  58. @media only screen and (max-width: 991px) {
  59. .table.table-no-more {
  60. &,
  61. thead,
  62. tbody,
  63. tr,
  64. th,
  65. td {
  66. display: block;
  67. }
  68. thead tr {
  69. left: -9999px;
  70. position: absolute;
  71. top: -9999px;
  72. }
  73. tr {
  74. border-bottom: 1px solid #DDD;
  75. }
  76. td {
  77. border: none;
  78. position: relative;
  79. padding-left: 50%;
  80. text-align: left;
  81. white-space: normal;
  82. &:before {
  83. content: attr(data-title);
  84. font-weight: bold;
  85. left: 6px;
  86. padding-right: 10px;
  87. position: absolute;
  88. text-align:left;
  89. top: 8px;
  90. white-space: nowrap;
  91. width: 45%;
  92. }
  93. }
  94. &.table-bordered {
  95. td {
  96. border-bottom: 1px solid #EFEFEF;
  97. }
  98. }
  99. &.table-condensed {
  100. td {
  101. &:before {
  102. top: 5px;
  103. }
  104. }
  105. }
  106. }
  107. }
  108. // DARK
  109. // -----------------------------------------------------------------------------
  110. /* Dark - Tables */
  111. html.dark {
  112. .table > thead > tr > th,
  113. .table > tbody > tr > th,
  114. .table > tfoot > tr > th,
  115. .table > thead > tr > td,
  116. .table > tbody > tr > td,
  117. .table > tfoot > tr > td,
  118. .table-bordered {
  119. border-color: darken($dark-color-3, 1%);
  120. }
  121. .table-striped > tbody > tr:nth-child(2n+1) > td,
  122. .table-striped > tbody > tr:nth-child(2n+1) > th {
  123. background-color: darken($dark-color-4, 3%);
  124. }
  125. .table-hover > tbody > tr:hover > td,
  126. .table-hover > tbody > tr:hover > th {
  127. background-color: darken($dark-color-4, 3.5%);
  128. }
  129. .table {
  130. .actions,
  131. .actions-hover {
  132. a {
  133. color: $dark-default-text;
  134. }
  135. }
  136. }
  137. }
  138. @media screen and (max-width: 991px) {
  139. html.dark .table-responsive {
  140. border-color: darken($dark-color-3, 1%);
  141. }
  142. }
  143. @media only screen and (max-width: 991px) {
  144. html.dark {
  145. .table.table-no-more tr,
  146. .table.table-no-more.table-bordered td {
  147. border-bottom-color: darken($dark-color-3, 1%);
  148. }
  149. }
  150. }
  151. // STATES
  152. // -----------------------------------------------------------------------------
  153. /* Tables - States */
  154. @each $state in $states {
  155. .table > thead > tr > td.#{nth($state,1)},
  156. .table > tbody > tr > td.#{nth($state,1)},
  157. .table > tfoot > tr > td.#{nth($state,1)},
  158. .table > thead > tr > th.#{nth($state,1)},
  159. .table > tbody > tr > th.#{nth($state,1)},
  160. .table > tfoot > tr > th.#{nth($state,1)},
  161. .table > thead > tr.#{nth($state,1)} > td,
  162. .table > tbody > tr.#{nth($state,1)} > td,
  163. .table > tfoot > tr.#{nth($state,1)} > td,
  164. .table > thead > tr.#{nth($state,1)} > th,
  165. .table > tbody > tr.#{nth($state,1)} > th,
  166. .table > tfoot > tr.#{nth($state,1)} > th {
  167. color: #FFF;
  168. background-color: nth($state,2);
  169. }
  170. }
  171. .table > thead > tr > td.dark,
  172. .table > tbody > tr > td.dark,
  173. .table > tfoot > tr > td.dark,
  174. .table > thead > tr > th.dark,
  175. .table > tbody > tr > th.dark,
  176. .table > tfoot > tr > th.dark,
  177. .table > thead > tr.dark > td,
  178. .table > tbody > tr.dark > td,
  179. .table > tfoot > tr.dark > td,
  180. .table > thead > tr.dark > th,
  181. .table > tbody > tr.dark > th,
  182. .table > tfoot > tr.dark > th {
  183. background-color: lighten($color-dark, 20%);
  184. color: $color-dark-inverse;
  185. }