tabledrag.css

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

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