You are here

tables.pcss.css in Drupal 10

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