_listing.scss 11 KB

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