_listing.scss 12 KB

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