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. tr {
  27. border-bottom: 0.0625rem solid var(--color-gray-200);
  28. &:hover,
  29. &:focus-within {
  30. color: var(--color-text);
  31. background: var(--color-bgblue-hover);
  32. }
  33. &.color-warning:hover,
  34. &.color-warning:focus {
  35. color: var(--color-text);
  36. background: #fdf8ed;
  37. }
  38. &.color-error:hover,
  39. &.color-error:focus {
  40. color: var(--color-text);
  41. background: #fcf4f2;
  42. }
  43. }
  44. tr,
  45. .draggable-table.tabledrag-disabled tr {
  46. color: var(--color-text);
  47. background: var(--color-white);
  48. }
  49. thead tr {
  50. border: 0;
  51. }
  52. td {
  53. box-sizing: border-box;
  54. height: 4rem;
  55. padding: var(--space-xs) var(--space-m);
  56. text-align: start;
  57. & .item-list ul {
  58. margin: 0;
  59. }
  60. &.is-active {
  61. background: none;
  62. }
  63. }
  64. /**
  65. * Target every .form-element input that parent is a form-item of a table cell.
  66. * This ignores the filter format select of the textarea editor.
  67. */
  68. td {
  69. & > .form-item > .form-element,
  70. & > .ajax-new-content > .form-item > .form-element,
  71. & > .form-item > .claro-autocomplete,
  72. & > .form-item > .claro-autocomplete > .form-element,
  73. & > .ajax-new-content > .form-item > .claro-autocomplete,
  74. & > .ajax-new-content > .form-item > .claro-autocomplete > .form-element {
  75. width: 100%;
  76. }
  77. & > .form-item > .form-element--type-select,
  78. & > .ajax-new-content > .form-item > .form-element--type-select {
  79. width: max-content;
  80. min-width: 100%;
  81. }
  82. }
  83. /* Win over table-file-multiple-widget. */
  84. th.is-disabled.is-disabled {
  85. color: var(--input--disabled-fg-color);
  86. }
  87. /* Force browsers to calculate the width of a 'select all' element. */
  88. th.select-all {
  89. width: 1px;
  90. }
  91. /**
  92. * Captions.
  93. */
  94. .caption {
  95. margin-block-end: 1.25rem; /* 20px */
  96. }
  97. tfoot {
  98. font-weight: bold;
  99. & tr {
  100. &:last-child {
  101. border-bottom: 0;
  102. }
  103. &:first-child td {
  104. border-top: 0.0625rem solid var(--color-gray-500);
  105. }
  106. }
  107. }
  108. /**
  109. * Responsive table cells.
  110. */
  111. th.priority-low,
  112. th.priority-medium,
  113. td.priority-low,
  114. td.priority-medium {
  115. display: none;
  116. }
  117. @media screen and (min-width: 38em) {
  118. th.priority-medium,
  119. td.priority-medium {
  120. display: table-cell;
  121. }
  122. }
  123. @media screen and (min-width: 60em) {
  124. th.priority-low,
  125. td.priority-low {
  126. display: table-cell;
  127. }
  128. }
  129. .tabledrag-toggle-weight-wrapper {
  130. margin-block-start: var(--space-l);
  131. line-height: calc(28rem / 16);
  132. & + table,
  133. & + .tableresponsive-toggle-columns + table {
  134. margin-block-start: 0;
  135. }
  136. }

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