tables.css

Claro styles for Tables.

File

core/themes/claro/css/components/tables.css

View source
  1. /*
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/3084859
  5. * @preserve
  6. */
  7. /**
  8. * @file
  9. * Claro styles for Tables.
  10. */
  11. table {
  12. width: 100%;
  13. margin-block: var(--space-l);
  14. border-collapse: collapse;
  15. }
  16. .sticky-header {
  17. min-width: 0;
  18. }
  19. caption {
  20. text-align: start;
  21. }
  22. th {
  23. position: relative;
  24. box-sizing: border-box;
  25. height: var(--space-xl);
  26. padding: var(--space-xs) var(--space-m);
  27. text-align: start;
  28. color: var(--color-text);
  29. background: var(--color-gray-050);
  30. line-height: 1.25rem; /* 20px */
  31. }
  32. tr {
  33. border-bottom: 0.0625rem solid var(--color-gray-200);
  34. &:hover,
  35. &:focus-within {
  36. color: var(--color-text);
  37. background: var(--color-bgblue-hover);
  38. }
  39. &.color-warning:hover,
  40. &.color-warning:focus {
  41. color: var(--color-text);
  42. background: #fdf8ed;
  43. }
  44. &.color-error:hover,
  45. &.color-error:focus {
  46. color: var(--color-text);
  47. background: #fcf4f2;
  48. }
  49. }
  50. tr,
  51. .draggable-table.tabledrag-disabled tr {
  52. color: var(--color-text);
  53. background: var(--color-white);
  54. }
  55. thead tr {
  56. border: 0;
  57. }
  58. td {
  59. box-sizing: border-box;
  60. height: 4rem;
  61. padding: var(--space-xs) var(--space-m);
  62. text-align: start;
  63. & .item-list ul {
  64. margin: 0;
  65. }
  66. &.is-active {
  67. background: none;
  68. }
  69. }
  70. /**
  71. * Target every .form-element input that parent is a form-item of a table cell.
  72. * This ignores the filter format select of the textarea editor.
  73. */
  74. td {
  75. & > .form-item > .form-element,
  76. & > .ajax-new-content > .form-item > .form-element,
  77. & > .form-item > .claro-autocomplete,
  78. & > .form-item > .claro-autocomplete > .form-element,
  79. & > .ajax-new-content > .form-item > .claro-autocomplete,
  80. & > .ajax-new-content > .form-item > .claro-autocomplete > .form-element {
  81. width: 100%;
  82. }
  83. & > .form-item > .form-element--type-select,
  84. & > .ajax-new-content > .form-item > .form-element--type-select {
  85. width: max-content;
  86. min-width: 100%;
  87. }
  88. }
  89. /* Win over table-file-multiple-widget. */
  90. th.is-disabled.is-disabled {
  91. color: var(--input--disabled-fg-color);
  92. }
  93. /* Force browsers to calculate the width of a 'select all' element. */
  94. th.select-all {
  95. width: 1px;
  96. }
  97. /**
  98. * Captions.
  99. */
  100. .caption {
  101. margin-block-end: 1.25rem; /* 20px */
  102. }
  103. tfoot {
  104. font-weight: bold;
  105. & tr {
  106. &:last-child {
  107. border-bottom: 0;
  108. }
  109. &:first-child td {
  110. border-top: 0.0625rem solid var(--color-gray-500);
  111. }
  112. }
  113. }
  114. /**
  115. * Responsive table cells.
  116. */
  117. th.priority-low,
  118. th.priority-medium,
  119. td.priority-low,
  120. td.priority-medium {
  121. display: none;
  122. }
  123. @media screen and (min-width: 38em) {
  124. th.priority-medium,
  125. td.priority-medium {
  126. display: table-cell;
  127. }
  128. }
  129. @media screen and (min-width: 60em) {
  130. th.priority-low,
  131. td.priority-low {
  132. display: table-cell;
  133. }
  134. }
  135. .tabledrag-toggle-weight-wrapper {
  136. margin-block-start: var(--space-l);
  137. line-height: calc(28rem / 16);
  138. & + table,
  139. & + .tableresponsive-toggle-columns + table {
  140. margin-block-start: 0;
  141. }
  142. }

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.