_listing.scss 12 KB

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