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

Layout: remove duplicate var declaration #39111

Merged
merged 1 commit into from Feb 28, 2022
Merged

Conversation

ramonjd
Copy link
Member

@ramonjd ramonjd commented Feb 28, 2022

Description

Another chapter in the "Things that have been bugging me but not large enough to warrant a PR" story book.

This PR removes the unnecessary var declaration $style = ''; in layout.php.

Testing Instructions

Check that layout blocks appear on the frontend as they should, and that we're generating the correct styles for various blocks (flex, justification, alignment).

Group, Navigation, Social Links blocks are neat to test with.

Some layout HTML
<!-- wp:group {"style":{"spacing":{"padding":{"top":"13px","right":"13px","bottom":"13px","left":"13px"},"blockGap":"128px"},"color":{"background":"#e4d3ef"}},"layout":{"inherit":false,"contentSize":"218px","wideSize":"150px"}} -->
<div class="wp-block-group has-background" style="background-color:#e4d3ef;padding-top:13px;padding-right:13px;padding-bottom:13px;padding-left:13px"><!-- wp:paragraph -->
<p>paragraph</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>paragraph</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>paragraph</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>paragraph</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:social-links {"layout":{"type":"flex","justifyContent":"center","orientation":"vertical"},"style":{"spacing":{"blockGap":"105px"}}} -->
<ul class="wp-block-social-links"><!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->

<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->

<!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /--></ul>
<!-- /wp:social-links -->

Types of changes

Code quality.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).
  • I've updated related schemas if appropriate.

gziolo
gziolo approved these changes Feb 28, 2022
Copy link
Member

@gziolo gziolo left a comment

Good catch 👍🏻

@gziolo gziolo merged commit 2386fac into trunk Feb 28, 2022
23 checks passed
@gziolo gziolo deleted the remove/layout-duplicate-style-var branch Feb 28, 2022
@github-actions github-actions bot added this to the Gutenberg 12.8 milestone Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants