_listing.scss 11 KB

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