_editor.scss 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. .wp-block-latest-posts {
  2. padding-left: 0;
  3. // Vertical margins logic
  4. &:not(.is-grid) > li {
  5. margin-top: var(--global--spacing-vertical);
  6. margin-bottom: var(--global--spacing-vertical);
  7. &:first-child {
  8. margin-top: 0;
  9. }
  10. &:last-child {
  11. margin-bottom: 0;
  12. }
  13. }
  14. &.is-grid > li {
  15. margin-bottom: var(--global--spacing-vertical);
  16. &:last-child {
  17. margin-bottom: 0;
  18. }
  19. }
  20. & > li > * {
  21. margin-top: calc(0.5 * var(--global--spacing-vertical));
  22. margin-bottom: calc(0.5 * var(--global--spacing-vertical));
  23. &:first-child {
  24. margin-top: 0;
  25. }
  26. &:last-child {
  27. margin-bottom: 0;
  28. }
  29. }
  30. // Post title
  31. & > li > a {
  32. font-family: var(--latest-posts--title-font-family);
  33. font-size: var(--latest-posts--title-font-size);
  34. font-weight: var(--heading--font-weight);
  35. line-height: var(--global--line-height-heading);
  36. }
  37. // Post date
  38. .wp-block-latest-posts__post-date {
  39. color: var(--global--color-foreground-low-contrast);
  40. font-size: var(--global--font-size-xs);
  41. line-height: var(--global--line-height-body);
  42. [class*="inner-container"] &,
  43. .has-background & {
  44. color: currentColor;
  45. }
  46. }
  47. // Post content
  48. .wp-block-latest-posts__post-excerpt,
  49. .wp-block-latest-posts__post-full-content {
  50. font-family: var(--latest-posts--description-font-family);
  51. font-size: var(--latest-posts--description-font-size);
  52. line-height: var(--global--line-height-body);
  53. }
  54. }
  55. @include media(tablet) {
  56. .wp-block-latest-posts.is-style-seedlet-alternating-grid {
  57. // Necessary so that the block boundaries are respected.
  58. overflow: hidden;
  59. > li {
  60. width: calc(50% - (0.5 * var(--global--spacing-horizontal)));
  61. max-width: calc(50% - (0.5 * var(--global--spacing-horizontal)));
  62. text-align: right;
  63. &:nth-child(2n + 1) {
  64. float: right;
  65. text-align: left;
  66. }
  67. }
  68. &.is-grid {
  69. display: inherit;
  70. > li {
  71. margin-top: var(--global--spacing-vertical);
  72. margin-right: 0;
  73. &:first-child {
  74. margin-top: 0;
  75. }
  76. &:last-child {
  77. margin-bottom: 0;
  78. }
  79. }
  80. }
  81. }
  82. }