Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

datatables.bootstrap5.scss 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. @import "../../scss/_bootstrap-extended/include";
  2. @import "datatables.net-bs5/css/dataTables.bootstrap5";
  3. /* FIX: broken ui in tablet devices */
  4. @media (hover: none) and (pointer: coarse) {
  5. table.dataTable {
  6. display: table;
  7. overflow-x: auto;
  8. }
  9. }
  10. /* Card header inside the datatable */
  11. div.dt-container {
  12. .card-header {
  13. display: flex;
  14. align-items: center;
  15. justify-content: space-between;
  16. }
  17. .dt-buttons .dt-button-down-arrow {
  18. display: none;
  19. }
  20. /* Remove left and right border from datatable with table-bordered class */
  21. .table.table-bordered.dataTable {
  22. &.dt-complex-header,
  23. &.dt-column-search {
  24. thead tr th {
  25. border-width: $border-width;
  26. &:first-child {
  27. border-inline-start-width: 0;
  28. }
  29. &:last-child {
  30. border-inline-end-width: 0;
  31. }
  32. }
  33. }
  34. th,
  35. td {
  36. &:last-child {
  37. border-width: 0;
  38. }
  39. }
  40. }
  41. /* Responsive datatable in desktop screen */
  42. @media screen and (width >= 1399.98px) {
  43. table.table-responsive {
  44. display: table;
  45. }
  46. }
  47. div.dt-search {
  48. input {
  49. margin-inline: .5rem 0;
  50. }
  51. }
  52. div.dt-layout-end > *:not(:first-child) {
  53. margin-inline: 0;
  54. }
  55. table.dataTable {
  56. border-collapse: collapse;
  57. inline-size: 100%;
  58. margin-block: 0 $spacer * 1;
  59. /* Checkbox height & width for datatables checkboxes */
  60. .form-check-input {
  61. block-size: $form-datatables-check-input-size;
  62. inline-size: $form-datatables-check-input-size;
  63. }
  64. thead {
  65. > tr {
  66. > th,
  67. > td {
  68. &.dt-orderable-asc,
  69. &.dt-orderable-desc {
  70. &:hover {
  71. outline: none !important;
  72. }
  73. }
  74. }
  75. }
  76. th {
  77. /* Used while complex headers */
  78. vertical-align: middle;
  79. }
  80. }
  81. .dt-control.dt-orderable-none .dt-column-order::before {
  82. opacity: 0;
  83. }
  84. td.dt-control::before {
  85. border: 2px solid;
  86. block-size: .55em;
  87. border-block-start: 0;
  88. border-inline-start: 0;
  89. inline-size: .55em;
  90. transform: rotate(-45deg);
  91. :dir(rtl) & {
  92. transform: rotate(-315deg);
  93. }
  94. }
  95. tr.dt-hasChild td.dt-control::before {
  96. border-block-start: 0;
  97. border-inline-start: 0;
  98. transform: rotate(45deg);
  99. :dir(rtl) & {
  100. transform: rotate(-45deg);
  101. }
  102. }
  103. &.table tbody > tr {
  104. &.selected,
  105. & > .selected {
  106. background-color: rgba(var(--#{$prefix}primary-rgb), .08);
  107. > * {
  108. box-shadow: none;
  109. color: var(--#{$prefix}body-color);
  110. }
  111. a {
  112. color: var(--#{$prefix}primary);
  113. }
  114. }
  115. }
  116. }
  117. div.dt-scroll-body {
  118. border-block-end-width: 0;
  119. }
  120. @media screen and (width <= 575.98px) {
  121. .card-header {
  122. .dt-action-buttons {
  123. padding-block-start: 1rem;
  124. }
  125. }
  126. .dtr-bs-modal.modal {
  127. .modal-body {
  128. padding: 0;
  129. .table {
  130. margin-block-end: 0;
  131. }
  132. }
  133. }
  134. }
  135. @media screen and (width <= 767.98px) {
  136. div.dt-info {
  137. padding-block: 0 $table-cell-padding-y;
  138. }
  139. }
  140. div.dt-length,
  141. div.dt-search {
  142. margin-block: $spacer * 1.5;
  143. }
  144. div.dt-length select {
  145. margin-inline: .5rem;
  146. }
  147. /* common style for light / dark */
  148. div.dt-paging ul.pagination .page-link {
  149. padding: $pagination-padding-y;
  150. font-size: $font-size-base;
  151. line-height: $pagination-line-height;
  152. @include border-radius($border-radius);
  153. }
  154. @media screen and (width <= 575.98px) {
  155. div.dt-paging ul.pagination .page-link {
  156. min-block-size:
  157. calc(
  158. #{"#{($font-size-sm * $pagination-line-height) + ($pagination-padding-y-sm * 2)} + calc(#{$pagination-border-width} * 2)"}
  159. );
  160. min-inline-size:
  161. calc(
  162. #{"#{($font-size-sm * $pagination-line-height) + ($pagination-padding-x-sm * 2.356)} + calc(#{$pagination-border-width} * 2)"}
  163. );
  164. padding-block: $pagination-padding-y-sm - .1055rem;
  165. padding-inline: $pagination-padding-y-sm - .1055rem;
  166. }
  167. div.dt-paging ul.pagination {
  168. .page-item {
  169. .next,
  170. .previous,
  171. .first,
  172. .last {
  173. &.page-link {
  174. padding-block: $pagination-padding-y-sm - .1055rem;
  175. padding-inline: $pagination-padding-y-sm - .1055rem;
  176. }
  177. }
  178. }
  179. }
  180. }
  181. div.dt-info {
  182. color: var(--#{$prefix}secondary-color);
  183. .select-info .select-item {
  184. margin-inline: .5rem;
  185. }
  186. }
  187. }
  188. /* DataTable within card */
  189. div.card-datatable {
  190. padding-block-end: $card-spacer-x-sm;
  191. }
  192. .table-bordered > :not(caption) > * > * {
  193. border-width: 0;
  194. }
  195. /* overrides styles of library for rtl */
  196. table.dataTable {
  197. &,
  198. thead,
  199. tfoot {
  200. th,
  201. td {
  202. &,
  203. &.dt-type-numeric,
  204. &.dt-type-date {
  205. text-align: start;
  206. }
  207. &:first-child{
  208. padding-inline: $card-spacer-x;
  209. }
  210. }
  211. th:last-child{
  212. padding-inline-end: $card-spacer-x-sm;
  213. }
  214. }
  215. thead {
  216. .dt-orderable-asc.dt-orderable-desc,
  217. .dt-ordering-desc,
  218. .dt-ordering-asc {
  219. .dt-column-order {
  220. inset-inline: auto 1em;
  221. &::before,
  222. &::after {
  223. background-color: var(--#{$prefix}heading-color);
  224. block-size: 1.125rem;
  225. content: "";
  226. inline-size: 1.125rem;
  227. mask-repeat: no-repeat;
  228. mask-size: 100% 100%;
  229. visibility: hidden;
  230. }
  231. &::before {
  232. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='m6.293 13.293l1.414 1.414L12 10.414l4.293 4.293l1.414-1.414L12 7.586z'/%3E%3C/svg%3E");
  233. }
  234. &::after {
  235. mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='M16.293 9.293L12 13.586L7.707 9.293l-1.414 1.414L12 16.414l5.707-5.707z'/%3E%3C/svg%3E");
  236. }
  237. }
  238. &:hover {
  239. .dt-column-order {
  240. &::before,
  241. &::after {
  242. visibility: visible;
  243. }
  244. }
  245. }
  246. }
  247. }
  248. }
  249. /* text align styles in modal */
  250. .modal.dtr-bs-modal .text-xxl-center {
  251. text-align: start !important;
  252. }