Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TT1 Blocks: RSS Block: Migrate CSS to theme.json #128

Open
scruffian opened this issue Dec 9, 2020 · 1 comment
Open

TT1 Blocks: RSS Block: Migrate CSS to theme.json #128

scruffian opened this issue Dec 9, 2020 · 1 comment
Assignees

Comments

@scruffian
Copy link
Collaborator

scruffian commented Dec 9, 2020

The code is:

.wp-block-rss {
	padding-left: 0;

	> li {
		list-style: none;
	}

	// Vertical margins logic
	&:not(.is-grid) > li {
		margin-top: calc(1.666 * var(--global--spacing-vertical));
		margin-bottom: calc(1.666 * var(--global--spacing-vertical));

		&:first-child {
			margin-top: 0;
		}

		&:last-child {
			margin-bottom: 0;
		}
	}

	&.is-grid {

		> li {
			margin-bottom: var(--global--spacing-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.333 * var(--global--spacing-vertical));
		margin-bottom: calc(0.333 * var(--global--spacing-vertical));

		&:first-child {
			margin-top: 0;
		}

		&:last-child {
			margin-bottom: 0;
		}
	}

	// Post title
	.wp-block-rss__item-title > a {
		display: inline-block;
		font-family: var(--latest-posts--title-font-family);
		font-size: var(--latest-posts--title-font-size);
		font-weight: var(--heading--font-weight);
		line-height: var(--global--line-height-heading);
		margin-bottom: calc(0.333 * var(--global--spacing-vertical));
	}

	// Post author
	.wp-block-rss__item-author {
		color: var(--global--color-primary);
		font-size: var(--global--font-size-md);
		line-height: var(--global--line-height-body);
	}

	// Post date
	.wp-block-rss__item-publish-date {
		color: var(--global--color-primary);
		font-size: var(--global--font-size-xs);
		line-height: var(--global--line-height-body);

		[class*="inner-container"] &,
		.has-background & {
			color: currentColor;
		}
	}

	// Post content
	.wp-block-rss__item-excerpt,
	.wp-block-rss__item-full-content {
		font-family: var(--latest-posts--description-font-family);
		font-size: var(--latest-posts--description-font-size);
		line-height: var(--global--line-height-body);
		margin-top: calc(0.666 * var(--global--spacing-vertical));
	}

	// Utility classes
	&.alignfull {
		padding-left: var(--global--spacing-unit);
		padding-right: var(--global--spacing-unit);

		.entry-content [class*="inner-container"] &,
		.entry-content .has-background & {
			padding-left: 0;
			padding-right: 0;
		}
	}
}

From #82

@scruffian
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant