_listing.scss 12 KB

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