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

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