You are here

tabledrag.css in Drupal 9

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