tables.css

Same filename in this branch
  1. main core/themes/claro/css/components/tables.css
  2. main core/themes/admin/css/components/tables.css
Same filename and directory in other branches
  1. 10 core/themes/claro/css/components/tables.css
  2. 11.x core/themes/claro/css/components/tables.css
  3. 9 core/themes/seven/css/components/tables.css
  4. 9 core/themes/claro/css/components/tables.css
  5. 8.9.x core/themes/seven/css/components/tables.css
  6. 8.9.x core/themes/claro/css/components/tables.css
  7. 11.x core/themes/admin/css/components/tables.css
  8. 11.x core/themes/default_admin/css/components/tables.css

Claro styles for Tables.

File

core/themes/default_admin/css/components/tables.css

View source
  1. /*
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/3084859
  5. * @preserve
  6. */
  7. /**
  8. * @file
  9. * Claro styles for Tables.
  10. */
  11. table {
  12. --cell-padding-y: var(--admin-space-density-m);
  13. --cell-padding-x: var(--admin-space-m);
  14. width: 100%;
  15. margin-block: var(--admin-space-l);
  16. border-collapse: collapse;
  17. thead {
  18. border-radius: var(--admin-radius-m);
  19. background: transparent;
  20. tr {
  21. border-block-end: 2px solid var(--admin-color-border-loud);
  22. &:hover {
  23. background: transparent;
  24. }
  25. }
  26. }
  27. th {
  28. background: var(--admin-color-bg-surface);
  29. font-size: var(--admin-font-size-s);
  30. font-weight: var(--admin-font-weight-bold);
  31. &,
  32. .form-item__label {
  33. color: var(--admin-color-text-loud);
  34. }
  35. }
  36. tbody {
  37. tr {
  38. border-block-end: 1px solid var(--admin-color-border-table);
  39. }
  40. td {
  41. height: auto;
  42. padding: var(--cell-padding-y) var(--cell-padding-x);
  43. }
  44. }
  45. tr,
  46. tr:focus-within,
  47. .draggable-table.tabledrag-disabled tr {
  48. color: var(--admin-color-text);
  49. background-color: transparent;
  50. &:hover {
  51. color: var(--admin-color-text);
  52. background: var(--admin-color-bg-item);
  53. }
  54. &.selected:hover {
  55. background: transparent;
  56. }
  57. }
  58. tr.selected {
  59. .gin--dark-mode
  60. td {
  61. background-color: var(--admin-color-bg-item-hover);
  62. }
  63. }
  64. td {
  65. a {
  66. -webkit-text-decoration: none;
  67. text-decoration: none;
  68. &:hover {
  69. -webkit-text-decoration: underline;
  70. text-decoration: underline;
  71. text-decoration-style: var(--admin-link-decoration-style);
  72. }
  73. }
  74. .group-label {
  75. color: var(--admin-color-text-loud);
  76. }
  77. }
  78. &.gin--sticky-table-header {
  79. position: sticky;
  80. z-index: 97;
  81. visibility: hidden;
  82. overflow: hidden;
  83. width: auto !important;
  84. margin-block-start: calc(var(--admin-space-xs) * -1);
  85. inset-block-start: calc(var(--admin-theme-toolbar-y-offset) + var(--admin-theme-height-sticky) - 1px);
  86. tr {
  87. display: block;
  88. width: max-content;
  89. }
  90. }
  91. }
  92. table.sticky-header {
  93. inset-inline-start: auto !important;
  94. min-width: 100%;
  95. max-width: fit-content;
  96. background: transparent;
  97. }
  98. table.position-sticky,
  99. table.sticky-header {
  100. thead {
  101. position: static;
  102. }
  103. &.--is-processed thead {
  104. pointer-events: none;
  105. tr {
  106. border-color: transparent;
  107. .sortable-heading.is-active > a::before {
  108. display: none;
  109. }
  110. }
  111. }
  112. }
  113. caption {
  114. text-align: start;
  115. }
  116. th {
  117. position: relative;
  118. box-sizing: border-box;
  119. height: var(--admin-space-2xl);
  120. padding: var(--admin-space-xs) var(--admin-space-m);
  121. text-align: start;
  122. color: var(--admin-color-text);
  123. background: var(--admin-color-bg-surface-nested);
  124. line-height: 1.25rem;
  125. /* 20px */
  126. }
  127. table th {
  128. @media (min-width: 61em) {
  129. height: auto;
  130. padding: var(--admin-space-m);
  131. }
  132. }
  133. /* The actual sort link. */
  134. .sortable-heading {
  135. padding: var(--admin-space-xs) var(--admin-space-m);
  136. & > a {
  137. display: block;
  138. padding-block: var(--admin-space-xs);
  139. padding-inline: 0 1.5rem;
  140. -webkit-text-decoration: none;
  141. text-decoration: none;
  142. color: inherit;
  143. &:focus,
  144. &:hover {
  145. -webkit-text-decoration: none;
  146. text-decoration: none;
  147. &::before {
  148. border-color: inherit;
  149. border-block-end-width: 0.1875rem;
  150. }
  151. &::after {
  152. opacity: 1;
  153. }
  154. }
  155. &::before {
  156. position: absolute;
  157. z-index: 0;
  158. inset-block-start: 0;
  159. inset-inline-end: 1rem;
  160. inset-block-end: -2px;
  161. inset-inline-start: 1rem;
  162. display: block;
  163. content: "";
  164. border-bottom: 0.125rem solid transparent;
  165. }
  166. &::after {
  167. position: absolute;
  168. inset-block-start: 50%;
  169. inset-inline-end: 1rem;
  170. width: 0.875rem;
  171. height: 1rem;
  172. margin-block-start: -0.5rem;
  173. content: "";
  174. opacity: 0.5;
  175. background: var(--admin-color-text-soft);
  176. background-size: contain;
  177. mask-image: var(--admin-icon-sort);
  178. mask-repeat: no-repeat;
  179. mask-position: center center;
  180. [dir="rtl"]
  181. }
  182. @media (forced-colors: active) {
  183. opacity: 1;
  184. background: linktext;
  185. mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8'%3e%3cpath d='M1.75.25v1.5h10.5V.25zm0 3v1.5h7.5v-1.5zm0 3v1.5h4.5v-1.5z' fill='%23000f33'/%3e%3c/svg%3e") no-repeat 50% 50%;
  186. }
  187. }
  188. }
  189. &.is-active > a {
  190. color: var(--admin-color-link);
  191. &::before {
  192. /* border-bottom: 0.1875rem solid var(--admin-color-link); */
  193. border-block-end: 0.1875rem solid var(--admin-color-primary-active);
  194. background-color: var(--admin-color-bg-item);
  195. border-start-start-radius: var(--admin-radius-s);
  196. border-start-end-radius: var(--admin-radius-s);
  197. }
  198. &::after {
  199. content: none;
  200. }
  201. &,
  202. &:hover,
  203. &:active {
  204. color: var(--admin-color-primary-active);
  205. }
  206. }
  207. &.is-active > a::before,
  208. > a:hover::before {
  209. width: 100%;
  210. inset-inline-start: 0;
  211. }
  212. }
  213. tr {
  214. border-bottom: 0.0625rem solid var(--admin-color-border);
  215. &:hover,
  216. &:focus-within {
  217. color: var(--admin-color-text);
  218. background: var(--admin-color-bg-item-hover);
  219. }
  220. &.color-warning:hover,
  221. &.color-warning:focus {
  222. color: var(--admin-color-text);
  223. background: #fdf8ed;
  224. }
  225. &.color-error:hover,
  226. &.color-error:focus {
  227. color: var(--admin-color-text);
  228. background: #fcf4f2;
  229. }
  230. }
  231. tr,
  232. .draggable-table.tabledrag-disabled tr {
  233. color: var(--admin-color-text);
  234. background: var(--admin-color-bg-disabled);
  235. }
  236. thead tr {
  237. border: 0;
  238. }
  239. td {
  240. box-sizing: border-box;
  241. height: 4rem;
  242. padding: var(--admin-space-xs) var(--admin-space-m);
  243. text-align: start;
  244. & .item-list ul {
  245. margin: 0;
  246. }
  247. &.is-active {
  248. background: none;
  249. }
  250. }
  251. /**
  252. * Target every .form-element input that parent is a form-item of a table cell.
  253. * This ignores the filter format select of the textarea editor.
  254. */
  255. td {
  256. & > .form-item {
  257. display: flex;
  258. align-items: center;
  259. }
  260. & > .form-item > .form-item__prefix {
  261. margin-inline-end: var(--admin-space-xs);
  262. white-space: nowrap;
  263. }
  264. & > .form-item > .form-item__suffix {
  265. margin-inline-start: var(--admin-space-xs);
  266. white-space: nowrap;
  267. }
  268. & > .form-item > .form-element,
  269. & > .ajax-new-content > .form-item > .form-element,
  270. & > .form-item > .claro-autocomplete,
  271. & > .form-item > .claro-autocomplete > .form-element,
  272. & > .ajax-new-content > .form-item > .claro-autocomplete,
  273. & > .ajax-new-content > .form-item > .claro-autocomplete > .form-element {
  274. width: 100%;
  275. }
  276. & > .form-item > .form-element--type-select,
  277. & > .ajax-new-content > .form-item > .form-element--type-select {
  278. width: max-content;
  279. min-width: 100%;
  280. }
  281. }
  282. /* Win over table-file-multiple-widget. */
  283. th.is-disabled.is-disabled {
  284. color: var(--admin-color-text-disabled);
  285. }
  286. /* Force browsers to calculate the width of a 'select all' element. */
  287. th.select-all {
  288. width: 1px;
  289. }
  290. /**
  291. * Captions.
  292. */
  293. .caption {
  294. margin-block-end: 1.25rem;
  295. /* 20px */
  296. }
  297. tfoot {
  298. font-weight: bold;
  299. & tr {
  300. &:last-child {
  301. border-bottom: 0;
  302. }
  303. &:first-child td {
  304. /* Intentionally a stronger divider than --admin-color-border; kept on the
  305. gray ramp so it isn't lightened to the default border tint. */
  306. border-top: 0.0625rem solid var(--admin-color-gray-500);
  307. }
  308. }
  309. }
  310. /**
  311. * Responsive table cells.
  312. */
  313. th.priority-low,
  314. th.priority-medium,
  315. td.priority-low,
  316. td.priority-medium {
  317. display: none;
  318. }
  319. @media screen and (min-width: 38em) {
  320. th.priority-medium,
  321. td.priority-medium {
  322. display: table-cell;
  323. }
  324. }
  325. @media screen and (min-width: 60em) {
  326. th.priority-low,
  327. td.priority-low {
  328. display: table-cell;
  329. }
  330. }
  331. .gin-table-scroll-wrapper {
  332. clear: both;
  333. overflow-x: auto;
  334. overflow-y: hidden;
  335. overscroll-behavior-x: contain;
  336. margin-block-start: calc(var(--admin-space-xs) * -1);
  337. }
  338. .gin-horizontal-scroll-shadow {
  339. background-color: var(--admin-color-bg-surface);
  340. background-image: linear-gradient(to right, var(--admin-color-bg-surface), var(--admin-color-bg-surface)), linear-gradient(to right, var(--admin-color-bg-surface), var(--admin-color-bg-surface)), linear-gradient(to right, rgb(0, 0, 0, 0.125), rgb(255, 255, 255, 0)), linear-gradient(to left, rgb(0, 0, 0, 0.125), rgb(255, 255, 255, 0));
  341. background-repeat: no-repeat;
  342. background-attachment: local, local, scroll, scroll;
  343. background-position:
  344. left center,
  345. right center,
  346. left center,
  347. right center;
  348. background-size:
  349. 1.5rem 100%,
  350. 1.5rem 100%,
  351. 0.75rem 100%,
  352. 0.75rem 100%;
  353. &:dir(rtl) {
  354. background-image: linear-gradient(to left, var(--admin-color-bg-surface), var(--admin-color-bg-surface)), linear-gradient(to left, var(--admin-color-bg-surface), var(--admin-color-bg-surface)), linear-gradient(to left, rgb(0, 0, 0, 0.125), rgb(255, 255, 255, 0)), linear-gradient(to right, rgb(0, 0, 0, 0.125), rgb(255, 255, 255, 0));
  355. background-position:
  356. right center,
  357. left center,
  358. right center,
  359. left center;
  360. }
  361. }
  362. .tablesort {
  363. background-color: var(--admin-color-primary-active);
  364. background-image: none;
  365. mask-image: var(--admin-icon-sort);
  366. mask-repeat: no-repeat;
  367. mask-position: 0 50%;
  368. }
  369. .tablesort--asc {
  370. mask-image: var(--admin-icon-sort-asc);
  371. @media (forced-colors: active) {
  372. background: linktext;
  373. }
  374. }
  375. .tablesort--desc {
  376. mask-image: var(--admin-icon-sort-desc);
  377. @media (forced-colors: active) {
  378. background: linktext;
  379. }
  380. }
  381. .field-plugin-settings-edit-wrapper {
  382. float: inline-end;
  383. + a {
  384. float: inline-start;
  385. }
  386. }
  387. .region-title {
  388. border-block-end: 2px solid var(--admin-color-text);
  389. }
  390. .field-multiple-table {
  391. th {
  392. padding-block: var(--admin-space-xs);
  393. padding-inline: var(--admin-space-l) var(--admin-space-m);
  394. border-block-end: 0;
  395. background: transparent;
  396. &.th__order {
  397. padding: 0;
  398. font-size: 0;
  399. }
  400. }
  401. thead {
  402. th {
  403. background: var(--admin-color-bg-header);
  404. &:first-of-type {
  405. border-start-start-radius: var(--admin-radius-m);
  406. border-end-start-radius: var(--admin-radius-m);
  407. }
  408. }
  409. &:not(:has(th:last-of-type:not([style*="display: none"]))) th:nth-last-of-type(2),
  410. th:last-of-type:not([style*="display: none"]) {
  411. border-start-end-radius: var(--admin-radius-m);
  412. border-end-end-radius: var(--admin-radius-m);
  413. }
  414. tr {
  415. border-block-end: 0;
  416. }
  417. .field-label .label,
  418. .form-item__label--multiple-value-form {
  419. display: inline-block;
  420. margin: 0;
  421. padding: var(--admin-space-xs) 0;
  422. letter-spacing: -0.025em;
  423. color: var(--admin-color-primary-active);
  424. font-size: var(--admin-font-size-l);
  425. font-weight: var(--admin-font-weight-bold);
  426. line-height: 1.33333em;
  427. }
  428. }
  429. tr .form-item:not(:last-of-type) {
  430. margin-block-end: var(--admin-space-m);
  431. }
  432. /* Fixes paragraphs extending beyond layout */
  433. .ck.ck-toolbar.ck-toolbar_grouping > .ck-toolbar__items {
  434. flex-wrap: wrap;
  435. }
  436. }
  437. .gin-layer-wrapper .views-table {
  438. margin-block-start: 0;
  439. }
  440. table td.field-plugin-summary-cell {
  441. vertical-align: middle;
  442. }
  443. table .views-field.views-field-operations {
  444. text-align: end;
  445. }

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