-
Notifications
You must be signed in to change notification settings - Fork 361
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
Archeo: Image with headline and description pattern #5467
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code LGTM.
I have some minor comments / questions about the design:
- The spacing between the heading and text looks tighter in the comp, should this be tightened?
- The way it stacks on mobile is the image appears on top of the text, but the comp suggests it should be the other way around.
return array( | ||
'title' => __( 'Image with headline and description', 'archeo' ), | ||
'categories' => array( 'pages' ), | ||
'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"5vw","right":"5vw","bottom":"5vw","left":"5vw"}}}} --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the bottom padding be 0, that way the image reaches all the way to the bottom of the group?
I made some changes:
I couldn't figure out how to change the order of its stacking without adding CSS. |
'categories' => array( 'pages' ), | ||
'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"5vw","right":"5vw","bottom":"0","left":"5vw"}}}} --> | ||
<div class="wp-block-group alignfull" style="padding-top:5vw;padding-right:5vw;padding-bottom:0;padding-left:5vw"><!-- wp:media-text {"mediaPosition":"right","mediaLink":"' . esc_url( get_template_directory_uri() ) . '/assets/images/chahk.jpg","mediaType":"image","mediaWidth":64,"verticalAlignment":"top"} --> | ||
<div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-top" style="grid-template-columns:auto 64%"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/chahk.jpg" alt="' . esc_attr__( 'Chahk: rain deity', 'archeo' ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:heading {"style":{"typography":{"fontSize":"clamp(64px, 6vw, 100px)","lineHeight":"1"},"spacing":{"margin":{"bottom":"48px"}}}} --><h2 id="chahk-raindeity" style="font-size:clamp(64px, 6vw, 100px);line-height:1;margin-bottom:48px">' . wp_kses_post( __( 'CHAHK:<br>RAIN<br>DEITY', 'archeo' ) ) . '</h2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a couple questions:
- Should the font-size value be a custom variable in theme.json too?
- Semantically, is it okay that this is an h2 instead of a paragraph? I changed it to a heading so that I could get margin control...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the font-size value be a custom variable in theme.json too?
I have the same question, and I think it would be great if it was a variable, I just don't know where it should sit in theme.json (Maybe just an extra font size? But then I don't think it's selectable from the editor.)
Semantically, is it okay that this is an h2 instead of a paragraph?
I think this is OK, as it's acting as a heading for this pattern.
Hmm.. @kjellr adjusted the comps for us so this would work nicely, maybe we should change them back to the other way around? 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great, thanks for picking it up!
The jpg is pretty big at 1.29MB, do we normally compress these before bundling them?
'categories' => array( 'pages' ), | ||
'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"5vw","right":"5vw","bottom":"0","left":"5vw"}}}} --> | ||
<div class="wp-block-group alignfull" style="padding-top:5vw;padding-right:5vw;padding-bottom:0;padding-left:5vw"><!-- wp:media-text {"mediaPosition":"right","mediaLink":"' . esc_url( get_template_directory_uri() ) . '/assets/images/chahk.jpg","mediaType":"image","mediaWidth":64,"verticalAlignment":"top"} --> | ||
<div class="wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-top" style="grid-template-columns:auto 64%"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/chahk.jpg" alt="' . esc_attr__( 'Chahk: rain deity', 'archeo' ) . '"/></figure><div class="wp-block-media-text__content"><!-- wp:heading {"style":{"typography":{"fontSize":"clamp(64px, 6vw, 100px)","lineHeight":"1"},"spacing":{"margin":{"bottom":"48px"}}}} --><h2 id="chahk-raindeity" style="font-size:clamp(64px, 6vw, 100px);line-height:1;margin-bottom:48px">' . wp_kses_post( __( 'CHAHK:<br>RAIN<br>DEITY', 'archeo' ) ) . '</h2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the wp:heading, we could use "textTransform":"uppercase"
to automatically make the text uppercase here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 2f4587c
Yes, but let's do them all at once after all the patterns are in the theme. If you open an issue and assign it to me, I'll take care of it. 👍 |
Let's replace the image with this transparent one for now: |
Oh weird. Does the Media & Text block always place the image on the top? |
Yes, unless you disable "Stack on mobile" |
cc2864a
to
2c095d7
Compare
This is ready for another review |
Just pushed a couple small updates:
I think this should be ready to go. |
Changes proposed in this Pull Request:
I made this using the media text block inside a full-width group block (for padding). @beafialho the image is exported with a white background, do you have one without it or with the background color of the site (in that case we may want the whole group block to have the same color as background for consistency)?
Related issue(s):
#5429