tabledrag.css

Same filename in this branch
  1. 10 core/profiles/demo_umami/themes/umami/css/classy/components/tabledrag.css
  2. 10 core/misc/dialog/off-canvas/css/tabledrag.css
  3. 10 core/themes/olivero/css/components/tabledrag.css
  4. 10 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. 11.x core/profiles/demo_umami/themes/umami/css/classy/components/tabledrag.css
  14. 11.x core/misc/dialog/off-canvas/css/tabledrag.css
  15. 11.x core/themes/olivero/css/components/tabledrag.css
  16. 11.x core/themes/claro/css/components/tabledrag.css
  17. 11.x 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. :root {
  16. --table-row--dragging-bg-color: #fe7;
  17. --table-row--last-dragged-bg-color: #ffb;
  18. }
  19. body.drag {
  20. cursor: move;
  21. }
  22. body.drag-y {
  23. cursor: row-resize;
  24. }
  25. /* The block region's title row in table. */
  26. .region-title {
  27. font-weight: bold;
  28. }
  29. /* Empty region message row in table. */
  30. .region-message {
  31. color: var(--color-gray-600);
  32. }
  33. /* If the region is populated, we shouldn't display the empty message. */
  34. .region-message.region-populated {
  35. display: none;
  36. }
  37. /**
  38. * Remove border-bottom from abbr element. Class is duplicated in the selector
  39. * to increase weight to be able to win normalize.css selectors.
  40. */
  41. .tabledrag-changed.tabledrag-changed {
  42. border-bottom: none;
  43. }
  44. /* Don't display the abbreviation of 'add-new' table rows. */
  45. .add-new .tabledrag-changed {
  46. display: none;
  47. }
  48. .draggable .tabledrag-changed {
  49. position: relative;
  50. left: calc(var(--space-xs) * -1); /* LTR */
  51. }
  52. [dir="rtl"] .draggable .tabledrag-changed {
  53. right: calc(var(--space-xs) * -1); /* LTR */
  54. left: auto;
  55. }
  56. .tabledrag-cell--only-drag .tabledrag-changed {
  57. width: var(--space-l);
  58. min-width: var(--space-l);
  59. }
  60. /**
  61. * Draggable row state colors.
  62. */
  63. .draggable.drag,
  64. .draggable.drag:focus {
  65. background-color: var(--table-row--dragging-bg-color);
  66. }
  67. .draggable.drag-previous {
  68. background-color: var(--table-row--last-dragged-bg-color);
  69. }
  70. /**
  71. * Reduce the spacing of draggable table cells.
  72. */
  73. .draggable-table td:first-child ~ td,
  74. .draggable-table th:first-child ~ th {
  75. padding-left: 0 /* LTR */;
  76. }
  77. [dir="rtl"] .draggable-table td:first-child ~ td,
  78. [dir="rtl"] .draggable-table th:first-child ~ th {
  79. padding-right: 0;
  80. padding-left: var(--space-m);
  81. }
  82. /* Auto width for weight selects and number inputs. */
  83. .draggable td .form-element--type-select[name$="][_weight]"], /* Multiple field */
  84. .draggable td .term-weight, /* Taxonomy term list */
  85. .draggable td .field-weight /* Field UI table */ {
  86. width: auto;
  87. }
  88. /**
  89. * Handle styles.
  90. */
  91. .tabledrag-handle {
  92. position: relative;
  93. z-index: 1;
  94. overflow: visible;
  95. cursor: move;
  96. text-align: center;
  97. vertical-align: text-top;
  98. }
  99. .tabledrag-handle::after {
  100. display: inline-block;
  101. width: var(--tabledrag-handle-icon-size);
  102. height: var(--tabledrag-handle-icon-size);
  103. margin-left: calc(var(--space-m) * -1); /* LTR */
  104. padding: var(--space-xs) var(--space-m);
  105. content: "";
  106. transition: transform 0.1s ease-in-out 0s;
  107. 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;
  108. }
  109. [dir="rtl"] .tabledrag-handle::after {
  110. margin-right: calc(var(--space-m) * -1);
  111. margin-left: 0;
  112. }
  113. /* Change icon and cursor if only vertical drag is allowed. */
  114. .tabledrag-handle.tabledrag-handle-y {
  115. cursor: row-resize;
  116. }
  117. .tabledrag-handle.tabledrag-handle-y::after {
  118. 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");
  119. background-size: 1rem 1rem;
  120. }
  121. @media (forced-colors: active) {
  122. .tabledrag-handle::after {
  123. content: "";
  124. background: linktext;
  125. -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");
  126. 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");
  127. -webkit-mask-repeat: no-repeat;
  128. mask-repeat: no-repeat;
  129. -webkit-mask-position: center;
  130. mask-position: center;
  131. }
  132. }
  133. .tabledrag-handle::after,
  134. .tabledrag-disabled .tabledrag-handle.tabledrag-handle.tabledrag-handle::after {
  135. transform: scale(1);
  136. }
  137. .tabledrag-handle:hover::after,
  138. .tabledrag-handle:focus::after,
  139. .draggable.drag .tabledrag-handle::after {
  140. transform: scale(1.25);
  141. }
  142. .tabledrag-handle:focus {
  143. outline: none !important;
  144. box-shadow: none !important;
  145. }
  146. .tabledrag-handle:focus::before {
  147. display: block;
  148. width: calc(var(--space-m) + (var(--space-xs) * 2)); /* Same as height. */
  149. height: calc(var(--space-m) + (var(--space-xs) * 2)); /* Hande svg height + its vertical padding */
  150. margin: 0 calc(var(--space-xs) * -1) calc((var(--space-m) + (var(--space-xs) * 2)) * -1); /* Bottom: handle height as negative value. */
  151. content: "";
  152. border-radius: var(--base-border-radius);
  153. outline: var(--outline-size) dotted transparent;
  154. box-shadow: 0 0 0 var(--focus-border-size) var(--color-focus);
  155. }
  156. /* Disabled tabledrag handle. */
  157. .tabledrag-disabled .tabledrag-handle {
  158. cursor: default;
  159. opacity: 0.4;
  160. }
  161. .tabledrag-disabled .tabledrag-handle.tabledrag-handle::before {
  162. content: normal;
  163. }
  164. /**
  165. * Enhancements for touch-capable screens.
  166. */
  167. /**
  168. * Increase handle size.
  169. */
  170. .touchevents .tabledrag-handle::after {
  171. padding-top: var(--space-s);
  172. padding-bottom: var(--space-s);
  173. }
  174. .touchevents .draggable .menu-item__link {
  175. padding-top: var(--space-xs);
  176. padding-bottom: var(--space-xs);
  177. }
  178. /**
  179. * Wrapper of the toggle weight button (styled as a link).
  180. */
  181. .tabledrag-toggle-weight-wrapper {
  182. text-align: right; /* LTR */
  183. }
  184. [dir="rtl"] .tabledrag-toggle-weight-wrapper {
  185. text-align: left;
  186. }
  187. /* Hide nested weight toggles as they are redundant. */
  188. .draggable-table .tabledrag-toggle-weight-wrapper {
  189. display: none;
  190. }
  191. /**
  192. * Keep crowded tabledrag cells vertically centered.
  193. */
  194. .tabledrag-cell {
  195. padding-top: 0;
  196. padding-bottom: 0;
  197. }
  198. /**
  199. * If the first table cell is empty (like in a multiple field widget table),
  200. * we can save some space for the following cells.
  201. * If it isn't empty (Field UI table, taxonomy term overview page), this CSS
  202. * class won't be added.
  203. */
  204. .tabledrag-cell--only-drag {
  205. width: 1px; /* This forces this cell to use the smallest possible width. */
  206. padding-right: 0; /* LTR */
  207. }
  208. [dir="rtl"] .tabledrag-cell--only-drag {
  209. padding-right: var(--space-m);
  210. padding-left: 0;
  211. }
  212. .tabledrag-cell-content {
  213. display: table;
  214. height: 100%;
  215. }
  216. .tabledrag-cell-content > * {
  217. display: table-cell;
  218. vertical-align: middle;
  219. }
  220. .tabledrag-cell-content__item {
  221. padding-right: var(--space-xs); /* LTR */
  222. }
  223. [dir="rtl"] .tabledrag-cell-content__item {
  224. padding-right: 0;
  225. padding-left: var(--space-xs);
  226. }
  227. .tabledrag-cell-content__item:empty {
  228. display: none;
  229. }
  230. .tabledrag-cell-content .indentation,
  231. [dir="rtl"] .tabledrag-cell-content .indentation {
  232. float: none;
  233. overflow: hidden;
  234. height: 100%;
  235. }
  236. .tabledrag-cell-content .tree {
  237. min-height: 100%;
  238. }
  239. /**
  240. * Safari (at least version 13.0) thinks that if we define a width or height for
  241. * and SVG, then we refer to the elements total size inside the SVG.
  242. * We only want to inherit the height of the parent element.
  243. */
  244. /* stylelint-disable-next-line unit-allowed-list */
  245. @media not all and (min-resolution: 0.001dpcm) {
  246. @supports (-webkit-appearance: none) {
  247. .tabledrag-cell-content .tree {
  248. overflow: visible;
  249. min-height: 0;
  250. }
  251. }
  252. }
  253. .tabledrag-cell-content .tabledrag-handle::after {
  254. vertical-align: middle;
  255. }
  256. /**
  257. * Indentation.
  258. */
  259. .indentation {
  260. position: relative;
  261. left: calc(var(--space-xs) * -0.5); /* LTR */
  262. float: left; /* LTR */
  263. width: calc(25rem / 16); /* 25px */
  264. height: calc(25rem / 16); /* 25px */
  265. background: none !important;
  266. line-height: 0;
  267. }
  268. [dir="rtl"] .indentation {
  269. right: calc(var(--space-xs) * -0.5);
  270. left: auto;
  271. float: right;
  272. }
  273. /**
  274. * Tree is the visual representation for the simultaneously moved draggable
  275. * rows.
  276. *
  277. * These rules are styling the inline SVG that is placed inside the .indentation
  278. * element.
  279. */
  280. .tree {
  281. width: calc(25rem / 16); /* 25px */
  282. height: calc(25rem / 16); /* 25px */
  283. }
  284. .tree__item {
  285. display: none;
  286. }
  287. /* LTR tree child. */
  288. .tree-child path:not(.tree__item-child-ltr) {
  289. display: none;
  290. }
  291. .tree-child path.tree__item-child-ltr {
  292. display: block;
  293. }
  294. /* RTL tree child. */
  295. [dir="rtl"] .tree-child path:not(.tree__item-child-rtl) {
  296. display: none;
  297. }
  298. [dir="rtl"] .tree-child path.tree__item-child-rtl {
  299. display: block;
  300. }
  301. /* Last LTR tree child. */
  302. .tree-child-last path:not(.tree__item-child-last-ltr) {
  303. display: none;
  304. }
  305. .tree-child-last path.tree__item-child-last-ltr {
  306. display: block;
  307. }
  308. /* Last RTL tree child. */
  309. [dir="rtl"] .tree-child-last path:not(.tree__item-child-last-rtl) {
  310. display: none;
  311. }
  312. [dir="rtl"] .tree-child-last path.tree__item-child-last-rtl {
  313. display: block;
  314. }
  315. /* Horizontal line. */
  316. .tree-child-horizontal path:not(.tree__item-horizontal) {
  317. display: none;
  318. }
  319. .tree-child-horizontal path.tree__item-horizontal {
  320. display: block;
  321. }

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