_listing.scss 11 KB

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