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. /* The actual sort link. */
  33. .sortable-heading {
  34. padding: 0 var(--space-m);
  35. & > a {
  36. display: block;
  37. padding-block: var(--space-xs);
  38. padding-inline: 0 1.5rem;
  39. -webkit-text-decoration: none;
  40. text-decoration: none;
  41. color: inherit;
  42. &:focus,
  43. &:hover {
  44. -webkit-text-decoration: none;
  45. text-decoration: none;
  46. &::before {
  47. border-color: inherit;
  48. }
  49. &::after {
  50. opacity: 1;
  51. }
  52. }
  53. &::before {
  54. position: absolute;
  55. z-index: 0;
  56. inset-block-start: 0;
  57. inset-inline-end: 1rem;
  58. inset-block-end: 0;
  59. inset-inline-start: 1rem;
  60. display: block;
  61. content: "";
  62. border-bottom: 0.125rem solid transparent;
  63. }
  64. &::after {
  65. position: absolute;
  66. inset-block-start: 50%;
  67. inset-inline-end: 1rem;
  68. width: 0.875rem;
  69. height: 1rem;
  70. margin-block-start: -0.5rem;
  71. content: "";
  72. opacity: 0.5;
  73. background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8'%3e%3cpath d='M1.75.25v1.5h10.5V.25zm0 3v1.5h7.5v-1.5zm0 3v1.5h4.5v-1.5z' fill='%23000f33'/%3e%3c/svg%3e") no-repeat 50% 50%;
  74. background-size: contain;
  75. [dir="rtl"]
  76. }
  77. @media (forced-colors: active) {
  78. opacity: 1;
  79. background: linktext;
  80. mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8'%3e%3cpath d='M1.75.25v1.5h10.5V.25zm0 3v1.5h7.5v-1.5zm0 3v1.5h4.5v-1.5z' fill='%23000f33'/%3e%3c/svg%3e") no-repeat 50% 50%;
  81. }
  82. }
  83. }
  84. &.is-active > a {
  85. color: var(--color-absolutezero);
  86. &::before {
  87. border-bottom: 0.1875rem solid var(--color-absolutezero);
  88. }
  89. &::after {
  90. content: none;
  91. }
  92. }
  93. }
  94. tr {
  95. border-bottom: 0.0625rem solid var(--color-gray-200);
  96. &:hover,
  97. &:focus-within {
  98. color: var(--color-text);
  99. background: var(--color-bgblue-hover);
  100. }
  101. &.color-warning:hover,
  102. &.color-warning:focus {
  103. color: var(--color-text);
  104. background: #fdf8ed;
  105. }
  106. &.color-error:hover,
  107. &.color-error:focus {
  108. color: var(--color-text);
  109. background: #fcf4f2;
  110. }
  111. }
  112. tr,
  113. .draggable-table.tabledrag-disabled tr {
  114. color: var(--color-text);
  115. background: var(--color-white);
  116. }
  117. thead tr {
  118. border: 0;
  119. }
  120. td {
  121. box-sizing: border-box;
  122. height: 4rem;
  123. padding: var(--space-xs) var(--space-m);
  124. text-align: start;
  125. & .item-list ul {
  126. margin: 0;
  127. }
  128. &.is-active {
  129. background: none;
  130. }
  131. }
  132. /**
  133. * Target every .form-element input that parent is a form-item of a table cell.
  134. * This ignores the filter format select of the textarea editor.
  135. */
  136. td {
  137. & > .form-item > .form-element,
  138. & > .ajax-new-content > .form-item > .form-element,
  139. & > .form-item > .claro-autocomplete,
  140. & > .form-item > .claro-autocomplete > .form-element,
  141. & > .ajax-new-content > .form-item > .claro-autocomplete,
  142. & > .ajax-new-content > .form-item > .claro-autocomplete > .form-element {
  143. width: 100%;
  144. }
  145. & > .form-item > .form-element--type-select,
  146. & > .ajax-new-content > .form-item > .form-element--type-select {
  147. width: max-content;
  148. min-width: 100%;
  149. }
  150. }
  151. /* Win over table-file-multiple-widget. */
  152. th.is-disabled.is-disabled {
  153. color: var(--input--disabled-fg-color);
  154. }
  155. /* Force browsers to calculate the width of a 'select all' element. */
  156. th.select-all {
  157. width: 1px;
  158. }
  159. /**
  160. * Captions.
  161. */
  162. .caption {
  163. margin-block-end: 1.25rem; /* 20px */
  164. }
  165. tfoot {
  166. font-weight: bold;
  167. & tr {
  168. &:last-child {
  169. border-bottom: 0;
  170. }
  171. &:first-child td {
  172. border-top: 0.0625rem solid var(--color-gray-500);
  173. }
  174. }
  175. }
  176. /**
  177. * Responsive table cells.
  178. */
  179. th.priority-low,
  180. th.priority-medium,
  181. td.priority-low,
  182. td.priority-medium {
  183. display: none;
  184. }
  185. @media screen and (min-width: 38em) {
  186. th.priority-medium,
  187. td.priority-medium {
  188. display: table-cell;
  189. }
  190. }
  191. @media screen and (min-width: 60em) {
  192. th.priority-low,
  193. td.priority-low {
  194. display: table-cell;
  195. }
  196. }
  197. .tabledrag-toggle-weight-wrapper {
  198. margin-block-start: var(--space-l);
  199. line-height: calc(28rem / 16);
  200. & + table,
  201. & + .tableresponsive-toggle-columns + table {
  202. margin-block-start: 0;
  203. }
  204. }

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