tables.pcss.css

Same filename in other branches
  1. 9 core/themes/claro/css/components/tables.pcss.css
  2. 8.9.x core/themes/claro/css/components/tables.pcss.css
  3. 11.x core/themes/claro/css/components/tables.pcss.css

Claro styles for Tables.

File

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

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

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