_listing.scss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679
  1. /* stylelint-disable selector-max-combinators */
  2. // General listings, like for pages, images or snippets
  3. ul.listing {
  4. @include unlist();
  5. }
  6. .listing {
  7. margin-bottom: 2em;
  8. color: theme('colors.text-context');
  9. font-size: 0.95em;
  10. ul {
  11. list-style-type: none;
  12. margin: 0;
  13. padding-inline-start: 0;
  14. }
  15. > li {
  16. padding: 1em 0;
  17. border-bottom: 1px dashed theme('colors.border-field-default');
  18. }
  19. h3 {
  20. margin: 0;
  21. font-size: 1em;
  22. }
  23. td,
  24. th {
  25. padding: 1.2em 1em;
  26. &.no-padding {
  27. padding: 0;
  28. }
  29. }
  30. &.small td,
  31. th {
  32. padding: 0.6em 1em;
  33. }
  34. td {
  35. vertical-align: top;
  36. }
  37. td.title {
  38. padding: 1em;
  39. line-height: 2em;
  40. }
  41. thead {
  42. font-size: 1.1em;
  43. color: theme('colors.text-context');
  44. border-bottom: 1px solid theme('colors.border-furniture');
  45. th {
  46. font-size: 0.9em;
  47. text-align: start;
  48. font-weight: normal;
  49. white-space: nowrap;
  50. }
  51. th.children {
  52. border: 0;
  53. }
  54. th a.label:not(.teal) {
  55. text-decoration: none;
  56. color: inherit;
  57. position: relative;
  58. &.icon:after {
  59. inset-inline-end: 0;
  60. }
  61. }
  62. }
  63. &:has(.bulk-action-checkbox) {
  64. td:first-child,
  65. th:first-child {
  66. // Bulk actions, use smaller width (48px) for smaller screens
  67. // (no need to match where the breadcrumbs are)
  68. width: theme('spacing.10');
  69. text-align: center;
  70. input[type='checkbox'] {
  71. margin-inline-end: 0;
  72. }
  73. }
  74. }
  75. &.full-width {
  76. margin-bottom: -3em; // this negates the padding added to the bottom of .content
  77. }
  78. .table-headers {
  79. border-bottom: 1px solid theme('colors.border-furniture');
  80. }
  81. tbody {
  82. border-bottom: 1px dashed theme('colors.border-field-default');
  83. tr {
  84. border-top: 1px dashed theme('colors.border-furniture');
  85. &:first-child {
  86. border-top: 1px dashed theme('colors.border-furniture');
  87. }
  88. }
  89. tr.selected {
  90. background-color: theme('colors.text-highlight');
  91. }
  92. }
  93. &.full-width tbody {
  94. border: 0;
  95. }
  96. &.chooser {
  97. tbody .parent-page {
  98. font-size: 1.15em;
  99. background-color: theme('colors.border-furniture');
  100. }
  101. tbody .parent-page .title {
  102. a {
  103. display: inline-block;
  104. }
  105. .w-status--label {
  106. border: 1px solid;
  107. }
  108. }
  109. tbody .title a {
  110. @include transition(none);
  111. display: block;
  112. }
  113. tbody tr:hover {
  114. background-color: theme('colors.surface-button-hover');
  115. color: theme('colors.text-button');
  116. .title a,
  117. .title a:hover,
  118. .title label {
  119. color: theme('colors.text-button');
  120. }
  121. .parent a {
  122. color: theme('colors.text-button');
  123. }
  124. .w-status {
  125. border-color: theme('colors.text-button');
  126. }
  127. }
  128. tbody tr.disabled td {
  129. opacity: 0.25;
  130. }
  131. tbody tr.disabled td.children {
  132. opacity: 1;
  133. }
  134. tbody tr.disabled:hover {
  135. background-color: inherit;
  136. color: inherit;
  137. .title {
  138. cursor: not-allowed;
  139. }
  140. .w-status {
  141. border-color: inherit;
  142. }
  143. }
  144. }
  145. &.small tbody tr {
  146. font-size: 1em;
  147. }
  148. &.full-width .divider td {
  149. padding-inline-start: 20px;
  150. }
  151. // specific columns
  152. .bulk {
  153. padding-inline-end: 0;
  154. label {
  155. font-size: 1em;
  156. display: block;
  157. width: 100%;
  158. position: relative;
  159. }
  160. label span {
  161. @apply w-sr-only;
  162. }
  163. input {
  164. margin-top: 3px;
  165. }
  166. }
  167. .title {
  168. word-break: break-word;
  169. .title-wrapper,
  170. h2 {
  171. @apply w-label-1;
  172. display: inline;
  173. margin: 0;
  174. vertical-align: middle;
  175. a {
  176. color: inherit;
  177. text-decoration: none;
  178. // stylelint-disable max-nesting-depth
  179. &:hover {
  180. color: theme('colors.text-link-default');
  181. }
  182. }
  183. }
  184. .icon.initial {
  185. margin: 3px 0.3em 0 0;
  186. vertical-align: top;
  187. }
  188. }
  189. .actions {
  190. float: inline-end;
  191. font-size: 0.8rem;
  192. margin: 0;
  193. a {
  194. text-decoration: none;
  195. }
  196. > li {
  197. float: inline-start;
  198. padding: 0 0.5em 0 0;
  199. vertical-align: middle;
  200. }
  201. }
  202. &--inline-actions td.title {
  203. display: flex;
  204. align-items: center;
  205. justify-content: space-between;
  206. flex-wrap: wrap;
  207. gap: 0.5rem;
  208. .title-wrapper {
  209. margin-inline-end: 2.5em;
  210. }
  211. .w-status {
  212. margin: 0;
  213. }
  214. }
  215. &--inline-actions .actions {
  216. display: inline-block;
  217. margin-top: 0;
  218. vertical-align: inherit;
  219. li {
  220. margin-bottom: 0;
  221. }
  222. .button {
  223. vertical-align: inherit;
  224. }
  225. }
  226. .moderate-actions form {
  227. float: inline-start;
  228. margin: 0 1em 1em 0;
  229. }
  230. .children,
  231. .no-children {
  232. padding: 0;
  233. vertical-align: middle;
  234. a {
  235. display: block;
  236. padding: 0;
  237. }
  238. }
  239. .children a {
  240. color: theme('colors.text-button-outline-default');
  241. display: block;
  242. text-align: center;
  243. .icon {
  244. width: 3rem;
  245. height: 3rem;
  246. }
  247. }
  248. .no-children a {
  249. color: theme('colors.text-button-outline-default');
  250. display: block;
  251. text-align: center;
  252. line-height: 3rem;
  253. .icon {
  254. width: 1.5rem;
  255. height: 1.5rem;
  256. }
  257. &:hover,
  258. &:focus {
  259. color: theme('colors.text-button-outline-default');
  260. }
  261. &:focus {
  262. opacity: 1; //opacity is already changed on hover on the parent tr
  263. }
  264. }
  265. &.small .children a .icon {
  266. width: 30px;
  267. height: 30px;
  268. }
  269. th.ord {
  270. text-align: center;
  271. .icon {
  272. width: 1rem;
  273. height: 1rem;
  274. vertical-align: middle;
  275. margin-inline-end: 2px;
  276. }
  277. &--active a,
  278. a:hover {
  279. color: theme('colors.text-button-outline-default');
  280. }
  281. }
  282. .handle {
  283. cursor: move;
  284. width: 20px;
  285. color: theme('colors.icon-secondary');
  286. &:hover {
  287. color: theme('colors.icon-secondary-hover');
  288. }
  289. }
  290. .ui-sortable-helper {
  291. border: 1px dashed theme('colors.border-field-default');
  292. border-width: 1px 0;
  293. td {
  294. display: none;
  295. }
  296. .ord,
  297. .title {
  298. display: table-cell;
  299. }
  300. }
  301. table .no-results-message {
  302. padding-inline-start: 20px;
  303. }
  304. .unpublished .title-wrapper {
  305. opacity: 0.7;
  306. }
  307. .w-status {
  308. margin: 0;
  309. margin-inline: 0;
  310. }
  311. &.images img {
  312. @include transition(border-color 0.2s ease);
  313. border: 3px solid theme('colors.surface-page');
  314. }
  315. }
  316. .image-choice {
  317. // Force the link to be displayed as a block, so its focus outline has the right shape.
  318. display: block;
  319. color: inherit;
  320. overflow-wrap: break-word;
  321. word-wrap: break-word;
  322. }
  323. // stylelint-disable-next-line no-duplicate-selectors
  324. ul.listing {
  325. border-top: 1px dashed theme('colors.border-field-default');
  326. margin-bottom: 2em;
  327. }
  328. table.listing {
  329. width: 100%;
  330. }
  331. // Use consistent spacing to the left and right of the header.
  332. .page-explorer .w-slim-header {
  333. @include media-breakpoint-up(md) {
  334. padding-inline-end: theme('spacing.6');
  335. }
  336. }
  337. .page-explorer .listing {
  338. position: relative;
  339. .table-headers,
  340. thead tr {
  341. height: 35px;
  342. }
  343. }
  344. .pagination {
  345. text-align: center;
  346. p {
  347. margin: 0;
  348. }
  349. ul {
  350. @include unlist();
  351. margin-top: -1.7em;
  352. }
  353. li {
  354. line-height: 1em;
  355. }
  356. .prev {
  357. float: inline-start;
  358. }
  359. .next {
  360. float: inline-end;
  361. }
  362. }
  363. .listing.full-width + .pagination {
  364. margin-top: 3em;
  365. border-top: 1px dashed theme('colors.border-furniture');
  366. padding: 2em 50px 0;
  367. }
  368. // listing filters
  369. .listing-filter {
  370. @include clearfix();
  371. background-color: theme('colors.surface-header');
  372. border-width: 1px 0;
  373. margin: 3em 0;
  374. }
  375. .filter-title {
  376. float: inline-start;
  377. font-size: 0.95em;
  378. padding: 1em;
  379. margin: 0 1em 0 0;
  380. background-color: theme('colors.border-furniture');
  381. }
  382. .filter-options {
  383. @include unlist();
  384. @include clearfix();
  385. overflow: hidden;
  386. li {
  387. padding: 0.8em;
  388. float: inline-start;
  389. }
  390. &__icon {
  391. width: 1em;
  392. height: 1em;
  393. margin-inline-end: 0.2em;
  394. vertical-align: middle;
  395. position: relative;
  396. top: -1px;
  397. }
  398. }
  399. @include media-breakpoint-up(sm) {
  400. .listing {
  401. &.horiz {
  402. display: grid;
  403. grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  404. align-items: flex-end;
  405. justify-items: initial;
  406. }
  407. &.images {
  408. border: 0;
  409. > li {
  410. padding: 1.5em;
  411. width: auto;
  412. height: auto;
  413. text-align: center;
  414. margin-top: -1px;
  415. border: 0;
  416. .bulk-action-checkbox {
  417. float: inline-start;
  418. margin: -0.5em 0.5em 0.5em -0.75em;
  419. }
  420. .bulk-action-checkbox + .image-choice {
  421. clear: both;
  422. margin-top: 1em;
  423. }
  424. .image {
  425. text-align: center;
  426. height: 180px;
  427. // Vertically center the image.
  428. &:before {
  429. content: '';
  430. display: inline-block;
  431. height: 100%;
  432. vertical-align: middle;
  433. margin-inline-end: -0.25em;
  434. }
  435. img {
  436. display: inline-block;
  437. vertical-align: middle;
  438. }
  439. }
  440. &:hover {
  441. img {
  442. border-color: theme('colors.border-button-outline-default');
  443. }
  444. }
  445. }
  446. }
  447. .bulk-action-checkbox {
  448. opacity: 0;
  449. &.show,
  450. &:checked {
  451. opacity: 1;
  452. }
  453. }
  454. .no-children {
  455. border-color: transparent;
  456. a {
  457. opacity: 0;
  458. }
  459. }
  460. tr:hover,
  461. tr:focus-within {
  462. .no-children a,
  463. .bulk-action-checkbox {
  464. opacity: 1;
  465. }
  466. }
  467. // used on the image listing
  468. li:hover,
  469. li:focus-within {
  470. .bulk-action-checkbox {
  471. opacity: 1;
  472. }
  473. }
  474. tr:hover .children {
  475. background-color: theme('colors.text-button-outline-default');
  476. .icon {
  477. color: theme('colors.surface-page');
  478. }
  479. }
  480. td.children:hover {
  481. background-color: theme('colors.text-button-outline-default');
  482. }
  483. table .no-results-message {
  484. padding-inline-start: 50px;
  485. }
  486. &:has(.bulk-action-checkbox) {
  487. // Bulk actions, match the width of the header spacing up until
  488. // the page title (final breadcrumb item):
  489. // Breadcrumbs left padding: 20px
  490. // Breadcrumbs toggle: 50px
  491. // Breadcrumbs toggle margin right: 10px
  492. // Total: 80px
  493. th:first-child,
  494. td:first-child {
  495. width: theme('spacing.20');
  496. // Follow the left padding for the breadcrumbs (20px)
  497. // so the checkbox align with the breadcrumbs toggle.
  498. padding-inline-start: theme('spacing.5');
  499. }
  500. th:nth-child(2),
  501. td:nth-child(2) {
  502. padding-inline-start: 0;
  503. }
  504. }
  505. // If no bulk actions are present, and nice padding is not applied,
  506. // apply the same 80px padding via the first column's left padding.
  507. &:not(.nice-padding &, .report &):not(:has(.bulk-action-checkbox)) {
  508. th:first-child,
  509. td:first-child {
  510. padding-inline-start: theme('spacing.20');
  511. }
  512. }
  513. &.full-width .divider td {
  514. padding-inline-start: 50px;
  515. }
  516. }
  517. }
  518. // State
  519. .listing__item--active {
  520. > .actions {
  521. visibility: visible;
  522. }
  523. }
  524. // stylelint-disable no-duplicate-selectors
  525. // Transitions
  526. .listing {
  527. thead .dropdown ul {
  528. @include transition(none);
  529. }
  530. .children,
  531. .no-children {
  532. @include transition(background-color 0.2s ease);
  533. }
  534. .children a,
  535. .no-children a {
  536. @include transition(all 0.2s ease);
  537. }
  538. }
  539. // Ordering
  540. td.ord {
  541. // Align with the row's title text, and the column's label.
  542. vertical-align: top;
  543. .handle {
  544. width: 100%;
  545. text-align: center;
  546. }
  547. }
  548. table.listing {
  549. th.ordered {
  550. color: theme('colors.text-link-default');
  551. }
  552. }