You are here

tabledrag.css in Drupal 10

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