_listing.scss 11 KB

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