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

Try: Make spacing overrides more specific in Seedlet #3017

Merged
merged 3 commits into from
Jan 14, 2021

Conversation

jacklenox
Copy link
Contributor

@jacklenox jacklenox commented Jan 13, 2021

This PR solves #2727 by rewriting some CSS rules that are unnecessarily global, as was done in Twenty Twenty One.

If this is a goer, we'll want to propagate this change to Seedlet's child themes.

Unlike Twenty Twenty One, I think there's just one instance where the specificity needs to be added because Seedlet has fewer editor tweaks than Twenty Twenty One. I used the same mixin approach as before anyway in case I'm wrong, and to ease adding this specific override anywhere else that needs it.

@jacklenox
Copy link
Contributor Author

This PR also solves #3015, I just tested it. 🙂

@@ -6,6 +6,8 @@
margin-top: inherit;
margin-bottom: inherit;

@include innerblock-margin-clear(".wp-block-column");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I'm following the use case here, but this is what it looks like when I place a paragraph inside a columns block inside a cover block:

Screen Shot 2021-01-13 at 1 42 02 PM

Should this mixin remove that top margin from the paragraph?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how well I'm following all this either, but I don't think so, and it doesn't seem to. If @kjellr wouldn't mind taking a glance at this, I'd much appreciate it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update: I've noticed that in viewing the post itself, there wouldn't be a top margin on those paragraphs, although there seem to be quite a few discrepancies when it comes to vertical spacing on the editor vs the post itself (both with, and without this PR), so I'm not sure how far we want to go in trying to rectify that as part of this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. In that case, is this mixin needed at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha. 🤔 Maybe not? I copied this implementation from Twenty Twenty One because I had assumed this was, for some reason, desirable.

I have to confess I couldn't actually work out exactly what this achieves on Twenty Twenty One either, but presumed I was missing something and we needed to keep it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's not needed let's leave it out. Keep it simple!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I'll make this change.

@@ -149,15 +149,6 @@
[data-block] {
margin-top: var(--global--spacing-vertical);
margin-bottom: var(--global--spacing-vertical);

[data-block]:first-child {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that removing these lines solves the social icons + buttons alignment issue in the editor.

@jacklenox
Copy link
Contributor Author

PR has been amended to reflect that we're just going with dropping the global margin settings as we don't think they're needed. So I think this is now ready to land subject to a final approval.

Copy link
Member

@scruffian scruffian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@scruffian scruffian merged commit 17c04ef into trunk Jan 14, 2021
@scruffian scruffian deleted the try/seedlet-more-specific-spacing-overrides branch January 14, 2021 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants