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. 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-repeat: no-repeat;
  127. mask-position: center;
  128. }
  129. }
  130. .tabledrag-handle::after,
  131. .tabledrag-disabled .tabledrag-handle.tabledrag-handle.tabledrag-handle::after {
  132. transform: scale(1);
  133. }
  134. .tabledrag-handle:hover::after,
  135. .tabledrag-handle:focus::after,
  136. .draggable.drag .tabledrag-handle::after {
  137. transform: scale(1.25);
  138. }
  139. .tabledrag-handle:focus {
  140. outline: none !important;
  141. box-shadow: none !important;
  142. }
  143. .tabledrag-handle:focus::before {
  144. display: block;
  145. width: calc(var(--space-m) + (var(--space-xs) * 2)); /* Same as height. */
  146. height: calc(var(--space-m) + (var(--space-xs) * 2)); /* Hande svg height + its vertical padding */
  147. margin: 0 calc(var(--space-xs) * -1) calc((var(--space-m) + (var(--space-xs) * 2)) * -1); /* Bottom: handle height as negative value. */
  148. content: "";
  149. border-radius: var(--base-border-radius);
  150. outline: var(--outline-size) dotted transparent;
  151. box-shadow: 0 0 0 var(--focus-border-size) var(--color-focus);
  152. }
  153. /* Disabled tabledrag handle. */
  154. .tabledrag-disabled .tabledrag-handle {
  155. cursor: default;
  156. opacity: 0.4;
  157. }
  158. .tabledrag-disabled .tabledrag-handle.tabledrag-handle::before {
  159. content: normal;
  160. }
  161. /**
  162. * Enhancements for touch-capable screens.
  163. */
  164. /**
  165. * Increase handle size.
  166. */
  167. .touchevents .tabledrag-handle::after {
  168. padding-top: var(--space-s);
  169. padding-bottom: var(--space-s);
  170. }
  171. .touchevents .draggable .menu-item__link {
  172. padding-top: var(--space-xs);
  173. padding-bottom: var(--space-xs);
  174. }
  175. /**
  176. * Wrapper of the toggle weight button (styled as a link).
  177. */
  178. .tabledrag-toggle-weight-wrapper {
  179. text-align: right; /* LTR */
  180. }
  181. [dir="rtl"] .tabledrag-toggle-weight-wrapper {
  182. text-align: left;
  183. }
  184. /* Hide nested weight toggles as they are redundant. */
  185. .draggable-table .tabledrag-toggle-weight-wrapper {
  186. display: none;
  187. }
  188. /**
  189. * Keep crowded tabledrag cells vertically centered.
  190. */
  191. .tabledrag-cell {
  192. padding-top: 0;
  193. padding-bottom: 0;
  194. }
  195. /**
  196. * If the first table cell is empty (like in a multiple field widget table),
  197. * we can save some space for the following cells.
  198. * If it isn't empty (Field UI table, taxonomy term overview page), this CSS
  199. * class won't be added.
  200. */
  201. .tabledrag-cell--only-drag {
  202. width: 1px; /* This forces this cell to use the smallest possible width. */
  203. padding-right: 0; /* LTR */
  204. }
  205. [dir="rtl"] .tabledrag-cell--only-drag {
  206. padding-right: var(--space-m);
  207. padding-left: 0;
  208. }
  209. .tabledrag-cell-content {
  210. display: table;
  211. height: 100%;
  212. }
  213. .tabledrag-cell-content > * {
  214. display: table-cell;
  215. vertical-align: middle;
  216. }
  217. .tabledrag-cell-content__item {
  218. padding-right: var(--space-xs); /* LTR */
  219. }
  220. [dir="rtl"] .tabledrag-cell-content__item {
  221. padding-right: 0;
  222. padding-left: var(--space-xs);
  223. }
  224. .tabledrag-cell-content__item:empty {
  225. display: none;
  226. }
  227. .tabledrag-cell-content .indentation,
  228. [dir="rtl"] .tabledrag-cell-content .indentation {
  229. float: none;
  230. overflow: hidden;
  231. height: 100%;
  232. }
  233. .tabledrag-cell-content .tree {
  234. min-height: 100%;
  235. }
  236. /**
  237. * Safari (at least version 13.0) thinks that if we define a width or height for
  238. * and SVG, then we refer to the elements total size inside the SVG.
  239. * We only want to inherit the height of the parent element.
  240. */
  241. /* stylelint-disable-next-line unit-allowed-list */
  242. @media not all and (min-resolution: 0.001dpcm) {
  243. @supports (-webkit-appearance: none) {
  244. .tabledrag-cell-content .tree {
  245. overflow: visible;
  246. min-height: 0;
  247. }
  248. }
  249. }
  250. .tabledrag-cell-content .tabledrag-handle::after {
  251. vertical-align: middle;
  252. }
  253. /**
  254. * Indentation.
  255. */
  256. .indentation {
  257. position: relative;
  258. left: calc(var(--space-xs) * -0.5); /* LTR */
  259. float: left; /* LTR */
  260. width: calc(25rem / 16); /* 25px */
  261. height: calc(25rem / 16); /* 25px */
  262. background: none !important;
  263. line-height: 0;
  264. }
  265. [dir="rtl"] .indentation {
  266. right: calc(var(--space-xs) * -0.5);
  267. left: auto;
  268. float: right;
  269. }
  270. /**
  271. * Tree is the visual representation for the simultaneously moved draggable
  272. * rows.
  273. *
  274. * These rules are styling the inline SVG that is placed inside the .indentation
  275. * element.
  276. */
  277. .tree {
  278. width: calc(25rem / 16); /* 25px */
  279. height: calc(25rem / 16); /* 25px */
  280. }
  281. .tree__item {
  282. display: none;
  283. }
  284. /* LTR tree child. */
  285. .tree-child path:not(.tree__item-child-ltr) {
  286. display: none;
  287. }
  288. .tree-child path.tree__item-child-ltr {
  289. display: block;
  290. }
  291. /* RTL tree child. */
  292. [dir="rtl"] .tree-child path:not(.tree__item-child-rtl) {
  293. display: none;
  294. }
  295. [dir="rtl"] .tree-child path.tree__item-child-rtl {
  296. display: block;
  297. }
  298. /* Last LTR tree child. */
  299. .tree-child-last path:not(.tree__item-child-last-ltr) {
  300. display: none;
  301. }
  302. .tree-child-last path.tree__item-child-last-ltr {
  303. display: block;
  304. }
  305. /* Last RTL tree child. */
  306. [dir="rtl"] .tree-child-last path:not(.tree__item-child-last-rtl) {
  307. display: none;
  308. }
  309. [dir="rtl"] .tree-child-last path.tree__item-child-last-rtl {
  310. display: block;
  311. }
  312. /* Horizontal line. */
  313. .tree-child-horizontal path:not(.tree__item-horizontal) {
  314. display: none;
  315. }
  316. .tree-child-horizontal path.tree__item-horizontal {
  317. display: block;
  318. }

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