_listing.scss 15 KB

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