You are here

tables.pcss.css in Drupal 9

Same filename and directory in other branches
  1. 8 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-whitesmoke);
  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/222330/sort--inactive--ltr.svg) no-repeat 50% 50%;
  79. background-size: contain;
  80. }
  81. /* stylelint-disable-next-line selector-type-no-unknown */
  82. _:-ms-fullscreen, /* Only IE 11 */
  83. .sortable-heading > a::after {
  84. position: static;
  85. float: right;
  86. margin-top: 0.125rem; /* 2px */
  87. margin-right: -1.5rem; /* -24px */
  88. }
  89. [dir="rtl"] .sortable-heading > a::after {
  90. right: auto;
  91. left: 1rem;
  92. background-image: url(../../images/icons/222330/sort--inactive--rtl.svg);
  93. }
  94. /* stylelint-disable-next-line selector-type-no-unknown */
  95. _:-ms-fullscreen, /* Only IE 11 */
  96. [dir="rtl"] .sortable-heading > a::after {
  97. float: left;
  98. margin-right: 0;
  99. margin-left: -1.5rem; /* -24px */
  100. }
  101. /* Sortable cell's link focus/hover state. */
  102. .sortable-heading > a:focus,
  103. .sortable-heading > a:hover {
  104. text-decoration: none;
  105. }
  106. .sortable-heading > a:focus::before,
  107. .sortable-heading > a:hover::before {
  108. border-color: inherit;
  109. }
  110. .sortable-heading > a:focus::after,
  111. .sortable-heading > a:hover::after {
  112. opacity: 1;
  113. }
  114. /* Sortable cell's active state. */
  115. .sortable-heading.is-active > a {
  116. color: var(--color-absolutezero);
  117. }
  118. .sortable-heading.is-active > a::before {
  119. border-bottom: 0.1875rem solid var(--color-absolutezero);
  120. }
  121. .sortable-heading.is-active > a::after {
  122. content: none;
  123. }
  124. tr {
  125. border-bottom: 0.0625rem solid var(--color-lightgray);
  126. }
  127. tr,
  128. .draggable-table.tabledrag-disabled tr {
  129. color: var(--color-text);
  130. background: var(--color-white);
  131. }
  132. thead tr {
  133. border: 0;
  134. }
  135. tr:hover,
  136. tr:focus {
  137. color: var(--color-text);
  138. background: var(--color-bgblue-hover);
  139. }
  140. tr.color-warning:hover,
  141. tr.color-warning:focus {
  142. color: var(--color-text);
  143. background: #fdf8ed;
  144. }
  145. tr.color-error:hover,
  146. tr.color-error:focus {
  147. color: var(--color-text);
  148. background: #fcf4f2;
  149. }
  150. td {
  151. box-sizing: border-box;
  152. height: 4rem;
  153. padding: var(--space-xs) var(--space-m);
  154. text-align: left; /* LTR */
  155. }
  156. [dir="rtl"] td {
  157. text-align: right;
  158. }
  159. td .item-list ul {
  160. margin: 0;
  161. }
  162. /* This is required to win over specificity of [dir="rtl"] .item-list ul */
  163. [dir="rtl"] td .item-list ul {
  164. margin: 0;
  165. }
  166. td.is-active {
  167. background: none;
  168. }
  169. /**
  170. * Target every .form-element input that parent is a form-item of a table cell.
  171. * This ignores the filter format select of the textarea editor.
  172. */
  173. td > .form-item > .form-element,
  174. td > .ajax-new-content > .form-item > .form-element {
  175. width: 100%;
  176. }
  177. /* Win over table-file-multiple-widget. */
  178. th.is-disabled.is-disabled {
  179. color: var(--input--disabled-fg-color);
  180. }
  181. /* Force browsers to calculate the width of a 'select all' element. */
  182. th.select-all {
  183. width: 1px;
  184. }
  185. /**
  186. * Captions.
  187. */
  188. .caption {
  189. margin-bottom: 1.25rem; /* 20px */
  190. }
  191. tfoot {
  192. font-weight: bold;
  193. }
  194. tfoot tr:last-child {
  195. border-bottom: 0;
  196. }
  197. tfoot tr:first-child td {
  198. border-top: 0.0625rem solid var(--color-grayblue);
  199. }
  200. /**
  201. * Responsive table cells.
  202. */
  203. th.priority-low,
  204. th.priority-medium,
  205. td.priority-low,
  206. td.priority-medium {
  207. display: none;
  208. }
  209. @media screen and (min-width: 38em) {
  210. th.priority-medium,
  211. td.priority-medium {
  212. display: table-cell;
  213. }
  214. }
  215. @media screen and (min-width: 60em) {
  216. th.priority-low,
  217. td.priority-low {
  218. display: table-cell;
  219. }
  220. }
  221. .tabledrag-toggle-weight-wrapper {
  222. margin-top: var(--space-l);
  223. line-height: calc(28rem / 16);
  224. }
  225. .tabledrag-toggle-weight-wrapper + table,
  226. .tabledrag-toggle-weight-wrapper + .tableresponsive-toggle-columns + table {
  227. margin-top: 0;
  228. }