tabledrag.css

Same filename in this branch
  1. 11.x core/profiles/demo_umami/themes/umami/css/classy/components/tabledrag.css
  2. 11.x core/misc/dialog/off-canvas/css/tabledrag.css
  3. 11.x core/themes/olivero/css/components/tabledrag.css
  4. 11.x core/themes/starterkit_theme/css/components/tabledrag.css
Same filename in other branches
  1. 9 core/profiles/demo_umami/themes/umami/css/classy/components/tabledrag.css
  2. 9 core/themes/olivero/css/components/tabledrag.css
  3. 9 core/themes/seven/css/classy/components/tabledrag.css
  4. 9 core/themes/claro/css/components/tabledrag.css
  5. 9 core/themes/bartik/css/classy/components/tabledrag.css
  6. 9 core/themes/starterkit_theme/css/components/tabledrag.css
  7. 9 core/themes/classy/css/components/tabledrag.css
  8. 8.9.x core/profiles/demo_umami/themes/umami/css/classy/components/tabledrag.css
  9. 8.9.x core/themes/seven/css/classy/components/tabledrag.css
  10. 8.9.x core/themes/claro/css/components/tabledrag.css
  11. 8.9.x core/themes/bartik/css/classy/components/tabledrag.css
  12. 8.9.x core/themes/classy/css/components/tabledrag.css
  13. 10 core/profiles/demo_umami/themes/umami/css/classy/components/tabledrag.css
  14. 10 core/misc/dialog/off-canvas/css/tabledrag.css
  15. 10 core/themes/olivero/css/components/tabledrag.css
  16. 10 core/themes/claro/css/components/tabledrag.css
  17. 10 core/themes/starterkit_theme/css/components/tabledrag.css

Replacement styles for table drag.

Replaces core's tabledrag.module.css.

See also

tabledrag.js

File

core/themes/claro/css/components/tabledrag.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. * Replacement styles for table drag.
  10. *
  11. * Replaces core's tabledrag.module.css.
  12. *
  13. * @see tabledrag.js
  14. */
  15. body.drag {
  16. cursor: move;
  17. }
  18. body.drag-y {
  19. cursor: row-resize;
  20. }
  21. .draggable-table {
  22. --table-row--dragging-bg-color: #fe7;
  23. --table-row--last-dragged-bg-color: #ffb;
  24. --tabledrag-handle-icon-size: 1.0625rem;
  25. /**
  26. * Reduce the spacing of draggable table cells.
  27. */
  28. }
  29. .draggable-table td:first-child ~ td,
  30. .draggable-table th:first-child ~ th {
  31. padding-inline-start: 0;
  32. }
  33. /* The block region's title row in table. */
  34. .region-title {
  35. font-weight: bold;
  36. }
  37. /* Empty region message row in table. */
  38. .region-message {
  39. color: var(--color-gray-600);
  40. }
  41. .region-message.region-populated {
  42. /* If the region is populated, we shouldn't display the empty message. */
  43. display: none;
  44. }
  45. /**
  46. * Remove border-bottom from abbr element. Class is duplicated in the selector
  47. * to increase weight to be able to win normalize.css selectors.
  48. */
  49. .tabledrag-changed.tabledrag-changed {
  50. border-bottom: none;
  51. }
  52. /* Don't display the abbreviation of 'add-new' table rows. */
  53. .add-new .tabledrag-changed {
  54. display: none;
  55. }
  56. .draggable .tabledrag-changed {
  57. position: relative;
  58. inset-inline-start: calc(var(--space-xs) * -1);
  59. }
  60. .tabledrag-cell--only-drag .tabledrag-changed {
  61. width: var(--space-l);
  62. min-width: var(--space-l);
  63. }
  64. /**
  65. * Draggable row state colors.
  66. */
  67. .draggable.drag,
  68. .draggable.drag:focus {
  69. background-color: var(--table-row--dragging-bg-color);
  70. }
  71. .draggable.drag-previous {
  72. background-color: var(--table-row--last-dragged-bg-color);
  73. }
  74. /* Auto width for weight selects and number inputs. */
  75. .draggable td .form-element--type-select[name$="][_weight]"], /* Multiple field */
  76. .draggable td .term-weight, /* Taxonomy term list */
  77. .draggable td .field-weight /* Field UI table */ {
  78. width: auto;
  79. }
  80. /**
  81. * Handle styles.
  82. */
  83. .tabledrag-handle {
  84. position: relative;
  85. z-index: 1;
  86. overflow: visible;
  87. cursor: move;
  88. text-align: center;
  89. vertical-align: text-top;
  90. }
  91. .tabledrag-handle::after {
  92. display: inline-block;
  93. width: var(--tabledrag-handle-icon-size);
  94. height: var(--tabledrag-handle-icon-size);
  95. margin-inline-start: calc(var(--space-m) * -1);
  96. padding: var(--space-xs) var(--space-m);
  97. content: "";
  98. transition: transform 0.1s ease-in-out 0s;
  99. background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 16 16'%3e%3cpath fill='%23000f33' d='M14.103 5.476a.5.5 0 00-.701-.053.526.526 0 00-.082.713l1.1 1.346H8.512V1.62l1.32 1.113a.501.501 0 00.732-.054.528.528 0 00-.085-.744L8.328.119a.5.5 0 00-.647 0L5.529 1.935a.527.527 0 00-.085.744.504.504 0 00.732.054l1.32-1.113v5.862H1.588L2.68 6.136a.526.526 0 00-.1-.68.5.5 0 00-.675.02L.117 7.67a.525.525 0 000 .66l1.788 2.194a.5.5 0 00.702.053.526.526 0 00.081-.713l-1.1-1.346h5.908v5.862l-1.32-1.113a.501.501 0 00-.698.082.526.526 0 00.051.716l2.152 1.817v-.001a.5.5 0 00.647 0l2.151-1.816a.526.526 0 00.052-.716.501.501 0 00-.699-.082l-1.32 1.113V8.518h5.908l-1.091 1.346a.527.527 0 00.022.776.504.504 0 00.752-.116l1.78-2.194a.527.527 0 000-.66z'/%3e%3c/svg%3e") no-repeat center;
  100. }
  101. @media (forced-colors: active) {
  102. .tabledrag-handle::after {
  103. background: linktext;
  104. mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 16 16'%3e%3cpath fill='%23000f33' d='M14.103 5.476a.5.5 0 00-.701-.053.526.526 0 00-.082.713l1.1 1.346H8.512V1.62l1.32 1.113a.501.501 0 00.732-.054.528.528 0 00-.085-.744L8.328.119a.5.5 0 00-.647 0L5.529 1.935a.527.527 0 00-.085.744.504.504 0 00.732.054l1.32-1.113v5.862H1.588L2.68 6.136a.526.526 0 00-.1-.68.5.5 0 00-.675.02L.117 7.67a.525.525 0 000 .66l1.788 2.194a.5.5 0 00.702.053.526.526 0 00.081-.713l-1.1-1.346h5.908v5.862l-1.32-1.113a.501.501 0 00-.698.082.526.526 0 00.051.716l2.152 1.817v-.001a.5.5 0 00.647 0l2.151-1.816a.526.526 0 00.052-.716.501.501 0 00-.699-.082l-1.32 1.113V8.518h5.908l-1.091 1.346a.527.527 0 00.022.776.504.504 0 00.752-.116l1.78-2.194a.527.527 0 000-.66z'/%3e%3c/svg%3e");
  105. mask-repeat: no-repeat;
  106. mask-position: center;
  107. }
  108. }
  109. /* Change icon and cursor if only vertical drag is allowed. */
  110. .tabledrag-handle.tabledrag-handle-y {
  111. cursor: row-resize;
  112. }
  113. .tabledrag-handle.tabledrag-handle-y::after {
  114. background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M2 8h12'/%3e%3cpath d='M8 2l2 2 -4 0 2 -2'/%3e%3cpath d='M8 14l2 -2 -4 0 2 2'/%3e%3c/svg%3e");
  115. background-size: 1rem 1rem;
  116. }
  117. .tabledrag-handle::after,
  118. .tabledrag-disabled .tabledrag-handle.tabledrag-handle.tabledrag-handle::after {
  119. transform: scale(1);
  120. }
  121. .tabledrag-handle:is(:hover, :focus)::after,
  122. .draggable.drag .tabledrag-handle::after {
  123. transform: scale(1.25);
  124. }
  125. .tabledrag-handle:focus {
  126. outline: none !important;
  127. box-shadow: none !important;
  128. }
  129. .tabledrag-handle:focus::before {
  130. display: block;
  131. width: calc(var(--space-m) + (var(--space-xs) * 2)); /* Same as height. */
  132. height: calc(var(--space-m) + (var(--space-xs) * 2)); /* Hande svg height + its vertical padding */
  133. margin: 0 calc(var(--space-xs) * -1) calc((var(--space-m) + (var(--space-xs) * 2)) * -1); /* Bottom: handle height as negative value. */
  134. content: "";
  135. border-radius: var(--base-border-radius);
  136. outline: var(--outline-size) dotted transparent;
  137. box-shadow: 0 0 0 var(--focus-border-size) var(--color-focus);
  138. }
  139. /* Disabled tabledrag handle. */
  140. .tabledrag-disabled .tabledrag-handle {
  141. cursor: default;
  142. opacity: 0.4;
  143. }
  144. .tabledrag-disabled .tabledrag-handle.tabledrag-handle::before {
  145. content: none;
  146. }
  147. /**
  148. * Enhancements for touch-capable screens.
  149. */
  150. /**
  151. * Increase handle size.
  152. */
  153. .touchevents .tabledrag-handle::after {
  154. padding-block: var(--space-s);
  155. }
  156. .touchevents .draggable .menu-item__link {
  157. padding-block: var(--space-xs);
  158. }
  159. /**
  160. * Wrapper of the toggle weight button (styled as a link).
  161. */
  162. .tabledrag-toggle-weight-wrapper {
  163. text-align: end;
  164. /* Hide nested weight toggles as they are redundant. */
  165. }
  166. .draggable-table .tabledrag-toggle-weight-wrapper {
  167. display: none;
  168. }
  169. /**
  170. * Keep crowded tabledrag cells vertically centered.
  171. */
  172. .tabledrag-cell {
  173. padding-block: 0;
  174. }
  175. /**
  176. * If the first table cell is empty (like in a multiple field widget table),
  177. * we can save some space for the following cells.
  178. * If it isn't empty (Field UI table, taxonomy term overview page), this CSS
  179. * class won't be added.
  180. */
  181. .tabledrag-cell--only-drag {
  182. width: 1px; /* This forces this cell to use the smallest possible width. */
  183. padding-inline-end: 0;
  184. }
  185. .tabledrag-cell-content {
  186. display: flex;
  187. align-items: center;
  188. height: 100%;
  189. }
  190. .tabledrag-cell-content > * {
  191. display: table-cell;
  192. vertical-align: middle;
  193. }
  194. .tabledrag-cell-content .tree {
  195. flex-grow: 1;
  196. }
  197. .tabledrag-cell-content .tabledrag-handle::after {
  198. vertical-align: middle;
  199. }
  200. .tabledrag-cell-content__item {
  201. padding-inline-end: var(--space-xs);
  202. }
  203. .tabledrag-cell-content__item:empty {
  204. display: none;
  205. }
  206. /**
  207. * Indentation.
  208. */
  209. .indentation {
  210. position: relative;
  211. inset-inline-start: calc(var(--space-xs) * -0.5);
  212. float: left; /* LTR */
  213. width: 1.5625rem;
  214. height: 1.5625rem;
  215. background: none !important;
  216. line-height: 0;
  217. }
  218. .tabledrag-cell-content .indentation {
  219. /* Fixes Safari bug (16.1 at least) where table rows are overly large when
  220. using indentation (e.g. re-ordering menu items. */
  221. display: inline-flex;
  222. float: none;
  223. overflow: hidden;
  224. flex-direction: column;
  225. height: 100%;
  226. }
  227. [dir="rtl"] .indentation {
  228. float: right;
  229. }
  230. /**
  231. * Tree is the visual representation for the simultaneously moved draggable
  232. * rows.
  233. *
  234. * These rules are styling the inline SVG that is placed inside the .indentation
  235. * element.
  236. */
  237. .tree {
  238. width: 1.5625rem;
  239. height: 1.5625rem;
  240. }
  241. .tree__item {
  242. display: none;
  243. }
  244. /* LTR tree child. */
  245. .tree-child path:not(.tree__item-child-ltr) {
  246. display: none;
  247. }
  248. .tree-child path.tree__item-child-ltr {
  249. display: block;
  250. }
  251. /* RTL tree child. */
  252. [dir="rtl"] .tree-child path:not(.tree__item-child-rtl) {
  253. display: none;
  254. }
  255. [dir="rtl"] .tree-child path.tree__item-child-rtl {
  256. display: block;
  257. }
  258. /* Last RTL tree child. */
  259. [dir="rtl"] .tree-child-last path:not(.tree__item-child-last-rtl) {
  260. display: none;
  261. }
  262. [dir="rtl"] .tree-child-last path.tree__item-child-last-rtl {
  263. display: block;
  264. }
  265. /* Last LTR tree child. */
  266. .tree-child-last path:not(.tree__item-child-last-ltr) {
  267. display: none;
  268. }
  269. .tree-child-last path.tree__item-child-last-ltr {
  270. display: block;
  271. }
  272. /* Horizontal line. */
  273. .tree-child-horizontal path:not(.tree__item-horizontal) {
  274. display: none;
  275. }
  276. .tree-child-horizontal path.tree__item-horizontal {
  277. display: block;
  278. }

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