123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- @import "@wordpress/base-styles/breakpoints";
- @import "@wordpress/base-styles/mixins";
- .wp-block-latest-posts {
- padding-left: 0;
- // Vertical margins logic
- &:not(.is-grid) > li {
- margin-top: var(--wp--custom--gap--vertical);
- margin-bottom: var(--wp--custom--gap--vertical);
- &:first-child {
- margin-top: 0;
- }
- &:last-child {
- margin-bottom: 0;
- }
- }
- &.is-grid {
- & > li {
- margin-bottom: var(--wp--custom--gap--vertical);
- &:last-child {
- margin-bottom: 0;
- }
- }
- // Remove bottom margins in grid columns
- &.columns-2 > li:nth-last-child(-n + 2):nth-child(2n + 1),
- &.columns-2 > li:nth-last-child(-n + 2):nth-child(2n + 1) ~ li,
- &.columns-3 > li:nth-last-child(-n + 3):nth-child(3n + 1),
- &.columns-3 > li:nth-last-child(-n + 3):nth-child(3n + 1) ~ li,
- &.columns-4 > li:nth-last-child(-n + 4):nth-child(4n + 1),
- &.columns-4 > li:nth-last-child(-n + 4):nth-child(4n + 1) ~ li,
- &.columns-5 > li:nth-last-child(-n + 5):nth-child(5n + 1),
- &.columns-5 > li:nth-last-child(-n + 5):nth-child(5n + 1) ~ li,
- &.columns-6 > li:nth-last-child(-n + 6):nth-child(6n + 1),
- &.columns-6 > li:nth-last-child(-n + 6):nth-child(6n + 1) ~ li {
- margin-bottom: 0;
- }
- }
- & > li > * {
- margin-top: calc(0.5 * var(--wp--custom--gap--vertical));
- margin-bottom: calc(0.5 * var(--wp--custom--gap--vertical));
- &:first-child {
- margin-top: 0;
- }
- &:last-child {
- margin-bottom: 0;
- }
- }
- // Post title
- & > li > a {
- font-family: var(--wp--preset--font-family--headings);
- line-height: 1.3;
- font-size: var(--wp--preset--font-size--huge);
- }
- // Post date
- .wp-block-latest-posts__post-date {
- font-size: var(--wp--preset--font-size--sm);
- .entry-content [class*="inner-container"] &,
- .entry-content .has-background & {
- color: currentColor;
- }
- }
- // Utility classes
- &.alignfull {
- padding-left: 0;
- padding-right: 0;
- .entry-content [class*="inner-container"] &,
- .entry-content .has-background & {
- padding-left: 0;
- padding-right: 0;
- }
- }
- }
- @include break-medium {
- .wp-block-latest-posts.is-style-seedlet-alternating-grid {
- // Necessary so that the block boundaries are respected.
- overflow: hidden;
- > li {
- width: calc(50% - (0.5 * var(--wp--custom--gap--horizontal)));
- max-width: calc(50% - (0.5 * var(--wp--custom--gap--horizontal)));
- text-align: right;
- &:nth-child(2n + 1) {
- float: right;
- text-align: left;
- }
- }
- &.is-grid {
- display: inherit;
- > li {
- margin-top: var(--wp--custom--gap--vertical);
- margin-right: 0;
- &:first-child {
- margin-top: 0;
- }
- &:last-child {
- margin-bottom: 0;
- }
- }
- }
- }
- }
|