tables.pcss.css

Same filename in other branches
  1. 8.9.x core/themes/claro/css/components/tables.pcss.css
  2. 10 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. @import "../base/variables.pcss.css";
  6. table {
  7. width: 100%;
  8. margin-top: var(--space-l);
  9. margin-bottom: var(--space-l);
  10. border-collapse: collapse;
  11. }
  12. .sticky-header {
  13. min-width: 0;
  14. }
  15. caption {
  16. text-align: left; /* LTR */
  17. }
  18. [dir="rtl"] caption {
  19. text-align: right;
  20. }
  21. th {
  22. position: relative;
  23. box-sizing: border-box;
  24. height: var(--space-xl);
  25. padding: var(--space-xs) var(--space-m);
  26. text-align: left; /* LTR */
  27. color: var(--color-text);
  28. background: var(--color-gray-050);
  29. line-height: 1.25rem; /* 20px */
  30. }
  31. [dir="rtl"] th {
  32. text-align: right;
  33. }
  34. /**
  35. * Table sort.
  36. */
  37. /* Table head cell containing sort link. */
  38. .sortable-heading {
  39. padding: 0 var(--space-m);
  40. }
  41. /* The actual sort link. */
  42. .sortable-heading > a {
  43. display: block;
  44. padding: var(--space-xs) 1.5rem var(--space-xs) 0; /* LTR */
  45. text-decoration: none;
  46. color: inherit;
  47. }
  48. [dir="rtl"] .sortable-heading > a {
  49. padding-right: 0;
  50. padding-left: 1.5rem;
  51. }
  52. .sortable-heading > a::before {
  53. position: absolute;
  54. z-index: 0;
  55. top: 0;
  56. right: 1rem;
  57. bottom: 0;
  58. left: 1rem;
  59. display: block;
  60. content: "";
  61. border-bottom: 0.125rem solid transparent;
  62. }
  63. /* stylelint-disable-next-line selector-type-no-unknown */
  64. _:-ms-fullscreen, /* Only IE 11 */
  65. .sortable-heading > a::before {
  66. top: auto;
  67. height: 100%;
  68. }
  69. .sortable-heading > a::after {
  70. position: absolute;
  71. top: 50%;
  72. right: 1rem;
  73. width: 0.875rem;
  74. height: 1rem;
  75. margin-top: -0.5rem;
  76. content: "";
  77. opacity: 0.5;
  78. background: url(../../images/icons/000f33/sort--inactive--ltr.svg) no-repeat 50% 50%;
  79. background-size: contain;
  80. @media (forced-colors: active) {
  81. opacity: 1;
  82. background: linktext;
  83. mask: url(../../images/icons/000f33/sort--inactive--ltr.svg) no-repeat 50% 50%;
  84. }
  85. }
  86. /* stylelint-disable-next-line selector-type-no-unknown */
  87. _:-ms-fullscreen, /* Only IE 11 */
  88. .sortable-heading > a::after {
  89. position: static;
  90. float: right;
  91. margin-top: 0.125rem; /* 2px */
  92. margin-right: -1.5rem; /* -24px */
  93. }
  94. [dir="rtl"] .sortable-heading > a::after {
  95. right: auto;
  96. left: 1rem;
  97. background-image: url(../../images/icons/000f33/sort--inactive--rtl.svg);
  98. @media (forced-colors: active) {
  99. background: linktext;
  100. mask: url(../../images/icons/000f33/sort--inactive--rtl.svg) no-repeat 50% 50%;
  101. }
  102. }
  103. /* stylelint-disable-next-line selector-type-no-unknown */
  104. _:-ms-fullscreen, /* Only IE 11 */
  105. [dir="rtl"] .sortable-heading > a::after {
  106. float: left;
  107. margin-right: 0;
  108. margin-left: -1.5rem; /* -24px */
  109. }
  110. /* Sortable cell's link focus/hover state. */
  111. .sortable-heading > a:focus,
  112. .sortable-heading > a:hover {
  113. text-decoration: none;
  114. }
  115. .sortable-heading > a:focus::before,
  116. .sortable-heading > a:hover::before {
  117. border-color: inherit;
  118. }
  119. .sortable-heading > a:focus::after,
  120. .sortable-heading > a:hover::after {
  121. opacity: 1;
  122. }
  123. /* Sortable cell's active state. */
  124. .sortable-heading.is-active > a {
  125. color: var(--color-absolutezero);
  126. }
  127. .sortable-heading.is-active > a::before {
  128. border-bottom: 0.1875rem solid var(--color-absolutezero);
  129. }
  130. .sortable-heading.is-active > a::after {
  131. content: none;
  132. }
  133. tr {
  134. border-bottom: 0.0625rem solid var(--color-gray-200);
  135. }
  136. tr,
  137. .draggable-table.tabledrag-disabled tr {
  138. color: var(--color-text);
  139. background: var(--color-white);
  140. }
  141. thead tr {
  142. border: 0;
  143. }
  144. tr:hover,
  145. tr:focus {
  146. color: var(--color-text);
  147. background: var(--color-bgblue-hover);
  148. }
  149. tr.color-warning:hover,
  150. tr.color-warning:focus {
  151. color: var(--color-text);
  152. background: #fdf8ed;
  153. }
  154. tr.color-error:hover,
  155. tr.color-error:focus {
  156. color: var(--color-text);
  157. background: #fcf4f2;
  158. }
  159. td {
  160. box-sizing: border-box;
  161. height: 4rem;
  162. padding: var(--space-xs) var(--space-m);
  163. text-align: left; /* LTR */
  164. }
  165. [dir="rtl"] td {
  166. text-align: right;
  167. }
  168. td .item-list ul {
  169. margin: 0;
  170. }
  171. /* This is required to win over specificity of [dir="rtl"] .item-list ul */
  172. [dir="rtl"] td .item-list ul {
  173. margin: 0;
  174. }
  175. td.is-active {
  176. background: none;
  177. }
  178. /**
  179. * Target every .form-element input that parent is a form-item of a table cell.
  180. * This ignores the filter format select of the textarea editor.
  181. */
  182. td > .form-item > .form-element,
  183. td > .ajax-new-content > .form-item > .form-element {
  184. width: 100%;
  185. }
  186. td > .form-item > .form-element--type-select,
  187. td > .ajax-new-content > .form-item > .form-element--type-select {
  188. width: auto;
  189. }
  190. @supports (min-width: max-content) {
  191. td > .form-item > .form-element--type-select,
  192. td > .ajax-new-content > .form-item > .form-element--type-select {
  193. width: max-content;
  194. min-width: 100%;
  195. }
  196. }
  197. /* Win over table-file-multiple-widget. */
  198. th.is-disabled.is-disabled {
  199. color: var(--input--disabled-fg-color);
  200. }
  201. /* Force browsers to calculate the width of a 'select all' element. */
  202. th.select-all {
  203. width: 1px;
  204. }
  205. /**
  206. * Captions.
  207. */
  208. .caption {
  209. margin-bottom: 1.25rem; /* 20px */
  210. }
  211. tfoot {
  212. font-weight: bold;
  213. }
  214. tfoot tr:last-child {
  215. border-bottom: 0;
  216. }
  217. tfoot tr:first-child td {
  218. border-top: 0.0625rem solid var(--color-gray-500);
  219. }
  220. /**
  221. * Responsive table cells.
  222. */
  223. th.priority-low,
  224. th.priority-medium,
  225. td.priority-low,
  226. td.priority-medium {
  227. display: none;
  228. }
  229. @media screen and (min-width: 38em) {
  230. th.priority-medium,
  231. td.priority-medium {
  232. display: table-cell;
  233. }
  234. }
  235. @media screen and (min-width: 60em) {
  236. th.priority-low,
  237. td.priority-low {
  238. display: table-cell;
  239. }
  240. }
  241. .tabledrag-toggle-weight-wrapper {
  242. margin-top: var(--space-l);
  243. line-height: calc(28rem / 16);
  244. }
  245. .tabledrag-toggle-weight-wrapper + table,
  246. .tabledrag-toggle-weight-wrapper + .tableresponsive-toggle-columns + table {
  247. margin-top: 0;
  248. }

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