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. -webkit-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-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");
  106. -webkit-mask-repeat: no-repeat;
  107. mask-repeat: no-repeat;
  108. -webkit-mask-position: center;
  109. mask-position: center;
  110. }
  111. }
  112. /* Change icon and cursor if only vertical drag is allowed. */
  113. .tabledrag-handle.tabledrag-handle-y {
  114. cursor: row-resize;
  115. }
  116. .tabledrag-handle.tabledrag-handle-y::after {
  117. 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");
  118. background-size: 1rem 1rem;
  119. }
  120. .tabledrag-handle::after,
  121. .tabledrag-disabled .tabledrag-handle.tabledrag-handle.tabledrag-handle::after {
  122. transform: scale(1);
  123. }
  124. .tabledrag-handle:is(:hover, :focus)::after,
  125. .draggable.drag .tabledrag-handle::after {
  126. transform: scale(1.25);
  127. }
  128. .tabledrag-handle:focus {
  129. outline: none !important;
  130. box-shadow: none !important;
  131. }
  132. .tabledrag-handle:focus::before {
  133. display: block;
  134. width: calc(var(--space-m) + (var(--space-xs) * 2)); /* Same as height. */
  135. height: calc(var(--space-m) + (var(--space-xs) * 2)); /* Hande svg height + its vertical padding */
  136. margin: 0 calc(var(--space-xs) * -1) calc((var(--space-m) + (var(--space-xs) * 2)) * -1); /* Bottom: handle height as negative value. */
  137. content: "";
  138. border-radius: var(--base-border-radius);
  139. outline: var(--outline-size) dotted transparent;
  140. box-shadow: 0 0 0 var(--focus-border-size) var(--color-focus);
  141. }
  142. /* Disabled tabledrag handle. */
  143. .tabledrag-disabled .tabledrag-handle {
  144. cursor: default;
  145. opacity: 0.4;
  146. }
  147. .tabledrag-disabled .tabledrag-handle.tabledrag-handle::before {
  148. content: none;
  149. }
  150. /**
  151. * Enhancements for touch-capable screens.
  152. */
  153. /**
  154. * Increase handle size.
  155. */
  156. .touchevents .tabledrag-handle::after {
  157. padding-block: var(--space-s);
  158. }
  159. .touchevents .draggable .menu-item__link {
  160. padding-block: var(--space-xs);
  161. }
  162. /**
  163. * Wrapper of the toggle weight button (styled as a link).
  164. */
  165. .tabledrag-toggle-weight-wrapper {
  166. text-align: end;
  167. /* Hide nested weight toggles as they are redundant. */
  168. }
  169. .draggable-table .tabledrag-toggle-weight-wrapper {
  170. display: none;
  171. }
  172. /**
  173. * Keep crowded tabledrag cells vertically centered.
  174. */
  175. .tabledrag-cell {
  176. padding-block: 0;
  177. }
  178. /**
  179. * If the first table cell is empty (like in a multiple field widget table),
  180. * we can save some space for the following cells.
  181. * If it isn't empty (Field UI table, taxonomy term overview page), this CSS
  182. * class won't be added.
  183. */
  184. .tabledrag-cell--only-drag {
  185. width: 1px; /* This forces this cell to use the smallest possible width. */
  186. padding-inline-end: 0;
  187. }
  188. .tabledrag-cell-content {
  189. display: flex;
  190. align-items: center;
  191. height: 100%;
  192. }
  193. .tabledrag-cell-content > * {
  194. display: table-cell;
  195. vertical-align: middle;
  196. }
  197. .tabledrag-cell-content .tree {
  198. flex-grow: 1;
  199. }
  200. .tabledrag-cell-content .tabledrag-handle::after {
  201. vertical-align: middle;
  202. }
  203. .tabledrag-cell-content__item {
  204. padding-inline-end: var(--space-xs);
  205. }
  206. .tabledrag-cell-content__item:empty {
  207. display: none;
  208. }
  209. /**
  210. * Indentation.
  211. */
  212. .indentation {
  213. position: relative;
  214. inset-inline-start: calc(var(--space-xs) * -0.5);
  215. float: left; /* LTR */
  216. width: 1.5625rem;
  217. height: 1.5625rem;
  218. background: none !important;
  219. line-height: 0;
  220. }
  221. .tabledrag-cell-content .indentation {
  222. /* Fixes Safari bug (16.1 at least) where table rows are overly large when
  223. using indentation (e.g. re-ordering menu items. */
  224. display: inline-flex;
  225. float: none;
  226. overflow: hidden;
  227. flex-direction: column;
  228. height: 100%;
  229. }
  230. [dir="rtl"] .indentation {
  231. float: right;
  232. }
  233. /**
  234. * Tree is the visual representation for the simultaneously moved draggable
  235. * rows.
  236. *
  237. * These rules are styling the inline SVG that is placed inside the .indentation
  238. * element.
  239. */
  240. .tree {
  241. width: 1.5625rem;
  242. height: 1.5625rem;
  243. }
  244. .tree__item {
  245. display: none;
  246. }
  247. /* LTR tree child. */
  248. .tree-child path:not(.tree__item-child-ltr) {
  249. display: none;
  250. }
  251. .tree-child path.tree__item-child-ltr {
  252. display: block;
  253. }
  254. /* RTL tree child. */
  255. [dir="rtl"] .tree-child path:not(.tree__item-child-rtl) {
  256. display: none;
  257. }
  258. [dir="rtl"] .tree-child path.tree__item-child-rtl {
  259. display: block;
  260. }
  261. /* Last RTL tree child. */
  262. [dir="rtl"] .tree-child-last path:not(.tree__item-child-last-rtl) {
  263. display: none;
  264. }
  265. [dir="rtl"] .tree-child-last path.tree__item-child-last-rtl {
  266. display: block;
  267. }
  268. /* Last LTR tree child. */
  269. .tree-child-last path:not(.tree__item-child-last-ltr) {
  270. display: none;
  271. }
  272. .tree-child-last path.tree__item-child-last-ltr {
  273. display: block;
  274. }
  275. /* Horizontal line. */
  276. .tree-child-horizontal path:not(.tree__item-horizontal) {
  277. display: none;
  278. }
  279. .tree-child-horizontal path.tree__item-horizontal {
  280. display: block;
  281. }

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