Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Try: add heading block style to paragraph #366

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ function twentytwentyfour_block_styles() {
'label' => __( 'Pill', 'twentytwentyfour' ),
)
);
register_block_style(
'core/paragraph',
array(
'name' => 'heading',
'label' => __( 'Heading', 'twentytwentyfour' ),
)
);
}
endif;

Expand Down
4 changes: 2 additions & 2 deletions patterns/about-2.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<div class="wp-block-column is-vertically-aligned-stretch" style="flex-basis:50%"><!-- wp:group {"style":{"dimensions":{"minHeight":"100%"}},"layout":{"type":"flex","orientation":"vertical","justifyContent":"stretch","verticalAlignment":"space-between"}} -->
<div class="wp-block-group" style="min-height:100%">

<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.2"}},"fontSize":"x-large","fontFamily":"cardo"} -->
<p class="has-cardo-font-family has-x-large-font-size" style="line-height:1.2"><?php echo esc_html_x( 'Études offers comprehensive consulting, management, design, and research solutions. Every architectural endeavor is an opportunity to shape the future.', 'Headline for the About pattern', 'twentytwentyfour' ); ?></p>
<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.2"}},"fontSize":"x-large","className":"heading"} -->
<p class="is-style-heading has-x-large-font-size" style="line-height:1.2"><?php echo esc_html_x( 'Études offers comprehensive consulting, management, design, and research solutions. Every architectural endeavor is an opportunity to shape the future.', 'Headline for the About pattern', 'twentytwentyfour' ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:group {"layout":{"type":"constrained","contentSize":"300px","justifyContent":"left"}} -->
Expand Down
4 changes: 2 additions & 2 deletions patterns/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

?>

<!-- wp:paragraph {"align":"center","style":{"typography":{"fontStyle":"italic","fontWeight":"400","lineHeight":"1.3"},"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50"}}},"backgroundColor":"base","fontSize":"large","fontFamily":"cardo"} -->
<p class="has-text-align-center has-base-background-color has-background has-cardo-font-family has-large-font-size" style="padding-top:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50);font-style:italic;font-weight:400;line-height:1.3">
<!-- wp:paragraph {"align":"center","style":{"typography":{"fontStyle":"italic","fontWeight":"400","lineHeight":"1.3"},"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50"}}},"backgroundColor":"base","className":"is-style-heading","fontSize":"large"} -->
<p class="has-text-align-center is-style-heading has-base-background-color has-background has-large-font-size" style="padding-top:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50);font-style:italic;font-weight:400;line-height:1.3">
<?php
/* Translators: About link placeholder */
$about_link = '<a href="#" rel="nofollow">' . esc_html__( 'Money Studies', 'twentytwentyfour' ) . '</a>';
Expand Down
4 changes: 2 additions & 2 deletions patterns/centered-statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50","left":"var:preset|spacing|50","right":"var:preset|spacing|50"},"margin":{"top":"0","bottom":"0"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull" style="margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--50);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50);padding-left:var(--wp--preset--spacing--50)"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|60","bottom":"var:preset|spacing|60","left":"var:preset|spacing|50","right":"var:preset|spacing|50"}},"border":{"radius":"16px"}},"backgroundColor":"base-2","layout":{"type":"default"}} -->
<div class="wp-block-group alignwide has-base-2-background-color has-background" style="border-radius:16px;padding-top:var(--wp--preset--spacing--60);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--60);padding-left:var(--wp--preset--spacing--50)"><!-- wp:paragraph {"align":"center","style":{"typography":{"lineHeight":"1.2","fontStyle":"normal","fontWeight":"400"}},"fontSize":"x-large","fontFamily":"cardo"} -->
<p class="has-text-align-center has-cardo-font-family has-x-large-font-size" style="font-style:normal;font-weight:400;line-height:1.2">
<div class="wp-block-group alignwide has-base-2-background-color has-background" style="border-radius:16px;padding-top:var(--wp--preset--spacing--60);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--60);padding-left:var(--wp--preset--spacing--50)"><!-- wp:paragraph {"align":"center","style":{"typography":{"lineHeight":"1.2","fontStyle":"normal","fontWeight":"400"}},"fontSize":"x-large","className":"heading"} -->
<p class="has-text-align-center is-style-heading has-x-large-font-size" style="font-style:normal;font-weight:400;line-height:1.2">
<?php
echo sprintf(
'%1$s<em>%2$s</em>%3$s',
Expand Down
4 changes: 2 additions & 2 deletions patterns/columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|50","right":"var:preset|spacing|50","bottom":"var:preset|spacing|50","left":"var:preset|spacing|50"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull" style="padding-top:var(--wp--preset--spacing--50);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50);padding-left:var(--wp--preset--spacing--50)"><!-- wp:columns {"align":"wide","style":{"spacing":{"blockGap":{"top":"var:preset|spacing|40","left":"var:preset|spacing|40"}}}} -->
<div class="wp-block-columns alignwide"><!-- wp:column {"width":"33%"} -->
<div class="wp-block-column" style="flex-basis:33%"><!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.2"}},"fontSize":"large","fontFamily":"cardo"} -->
<p class="has-cardo-font-family has-large-font-size" style="line-height:1.2"><?php echo esc_html__( 'We recognize the role architecture plays in shaping a sustainable future.', 'twentytwentyfour' ); ?></p>
<div class="wp-block-column" style="flex-basis:33%"><!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.2"}},"fontSize":"large","className":"heading"} -->
<p class="is-style-heading has-large-font-size" style="line-height:1.2"><?php echo esc_html__( 'We recognize the role architecture plays in shaping a sustainable future.', 'twentytwentyfour' ); ?></p>
<!-- /wp:paragraph --></div>
<!-- /wp:column -->

Expand Down
4 changes: 2 additions & 2 deletions patterns/footer-portfolio.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

<!-- wp:columns {"style":{"spacing":{"padding":{"top":"var:preset|spacing|10"}}}} -->
<div class="wp-block-columns" style="padding-top:var(--wp--preset--spacing--10)"><!-- wp:column {"width":"57%"} -->
<div class="wp-block-column" style="flex-basis:57%"><!-- wp:paragraph {"fontSize":"x-large","fontFamily":"cardo"} -->
<p class="has-cardo-font-family has-x-large-font-size">Resta al passo, contattaci.</p>
<div class="wp-block-column" style="flex-basis:57%"><!-- wp:paragraph {"fontSize":"x-large","className":"heading"} -->
<p class="is-style-heading has-x-large-font-size">Resta al passo, contattaci.</p>
<!-- /wp:paragraph --></div>
<!-- /wp:column -->

Expand Down
4 changes: 2 additions & 2 deletions patterns/hidden-hidden-intro-text-left.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<div class="wp-block-columns alignwide"><!-- wp:column {"width":"70%"} -->
<div class="wp-block-column" style="flex-basis:70%">

<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.2"}},"fontSize":"xx-large","fontFamily":"cardo"} -->
<p class="has-cardo-font-family has-xx-large-font-size" style="line-height:1.2">Sono <em>Leia Acosta</em>, una fotografa appassionata che trova ispirazione nel catturare la bellezza fugace della vita.</p>
<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.2"}},"fontSize":"xx-large","className":"heading"} -->
<p class="is-style-heading has-xx-large-font-size" style="line-height:1.2">Sono <em>Leia Acosta</em>, una fotografa appassionata che trova ispirazione nel catturare la bellezza fugace della vita.</p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:column -->
Expand Down
4 changes: 2 additions & 2 deletions patterns/project-description.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<!-- wp:column {"width":"60%"} -->
<div class="wp-block-column" style="flex-basis:60%">

<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.2"}},"fontSize":"x-large","fontFamily":"cardo"} -->
<p class="has-cardo-font-family has-x-large-font-size" style="line-height:1.2"><?php echo esc_html_x( 'This transformative project seeks to enhance the gallery\'s infrastructure, accessibility, and exhibition spaces while preserving its rich cultural heritage.', 'A heading type project description.', 'twentytwentyfour' ); ?></p>
<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.2"}},"fontSize":"x-large","className":"heading"} -->
<p class="is-style-heading has-x-large-font-size" style="line-height:1.2"><?php echo esc_html_x( 'This transformative project seeks to enhance the gallery\'s infrastructure, accessibility, and exhibition spaces while preserving its rich cultural heritage.', 'A heading type project description.', 'twentytwentyfour' ); ?></p>
<!-- /wp:paragraph -->

</div>
Expand Down
4 changes: 2 additions & 2 deletions patterns/project-details.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<!-- wp:column {"width":"60%","style":{"spacing":{"blockGap":"var:preset|spacing|40"}}} -->
<div class="wp-block-column" style="flex-basis:60%">

<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.2"}},"fontSize":"x-large","fontFamily":"cardo"} -->
<p class="has-cardo-font-family has-x-large-font-size" style="line-height:1.2">With meticulous attention to detail and a commitment to excellence, we create spaces that inspire, elevate, and enrich the lives of those who inhabit them.</p>
<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.2"}},"fontSize":"x-large","className":"heading"} -->
<p class="is-style-heading has-x-large-font-size" style="line-height:1.2">With meticulous attention to detail and a commitment to excellence, we create spaces that inspire, elevate, and enrich the lives of those who inhabit them.</p>
<!-- /wp:paragraph -->

<!-- wp:columns {"style":{"spacing":{"blockGap":{"top":"var:preset|spacing|30","left":"var:preset|spacing|30"}}}} -->
Expand Down
4 changes: 2 additions & 2 deletions patterns/rsvp.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<div class="wp-block-column is-vertically-aligned-stretch" style="flex-basis:50%"><!-- wp:group {"style":{"dimensions":{"minHeight":"100%"},"spacing":{"blockGap":"var:preset|spacing|50"}},"layout":{"type":"flex","orientation":"vertical","justifyContent":"left","verticalAlignment":"space-between"}} -->
<div class="wp-block-group" style="min-height:100%">

<!-- wp:paragraph {"align":"right","style":{"typography":{"writingMode":"vertical-rl","fontSize":"12rem","lineHeight":"1"},"spacing":{"margin":{"right":"0","left":"calc( var(--wp--preset--spacing--30) * -1)"}}},"fontFamily":"cardo"} -->
<p class="has-text-align-right has-cardo-font-family" style="margin-right:0;margin-left:calc( var(--wp--preset--spacing--30) * -1);font-size:12rem;line-height:1;writing-mode:vertical-rl"><?php echo esc_html_x( 'RSVP', 'Initials for ´please respond´', 'twentytwentyfour' ); ?></p>
<!-- wp:paragraph {"align":"right","style":{"typography":{"writingMode":"vertical-rl","fontSize":"12rem","lineHeight":"1"},"spacing":{"margin":{"right":"0","left":"calc( var(--wp--preset--spacing--30) * -1)"}}},"className":"heading"} -->
<p class="has-text-align-right is-style-heading" style="margin-right:0;margin-left:calc( var(--wp--preset--spacing--30) * -1);font-size:12rem;line-height:1;writing-mode:vertical-rl"><?php echo esc_html_x( 'RSVP', 'Initials for ´please respond´', 'twentytwentyfour' ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:group {"layout":{"type":"constrained","contentSize":"300px","justifyContent":"left"}} -->
Expand Down
4 changes: 2 additions & 2 deletions patterns/testimonial.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|60","bottom":"var:preset|spacing|60","left":"var:preset|spacing|60","right":"var:preset|spacing|60"}}},"backgroundColor":"contrast","textColor":"base","layout":{"type":"default"}} -->
<div class="wp-block-group alignfull has-base-color has-contrast-background-color has-text-color has-background" style="padding-top:var(--wp--preset--spacing--60);padding-right:var(--wp--preset--spacing--60);padding-bottom:var(--wp--preset--spacing--60);padding-left:var(--wp--preset--spacing--60)">

<!-- wp:paragraph {"align":"center","style":{"spacing":{"margin":{"bottom":"2rem"},"padding":{"right":"0","left":"0"}},"typography":{"lineHeight":"1.2","letterSpacing":"-0.02em"}},"textColor":"base","fontSize":"x-large","fontFamily":"cardo"} -->
<p class="has-text-align-center has-base-color has-text-color has-cardo-font-family has-x-large-font-size" style="margin-bottom:2rem;padding-right:0;padding-left:0;letter-spacing:-0.02em;line-height:1.2"><em><?php echo esc_html_x( '“Études has saved us thousands of hours of work and has unlocked insights we never thought possible.”', 'Testimonial Text or Review Text Got From the Person', 'twentytwentyfour' ); ?></em></p>
<!-- wp:paragraph {"align":"center","style":{"spacing":{"margin":{"bottom":"2rem"},"padding":{"right":"0","left":"0"}},"typography":{"lineHeight":"1.2","letterSpacing":"-0.02em"}},"textColor":"base","fontSize":"x-large","className":"heading"} -->
<p class="has-text-align-center has-base-color has-text-color is-style-heading has-x-large-font-size" style="margin-bottom:2rem;padding-right:0;padding-left:0;letter-spacing:-0.02em;line-height:1.2"><em><?php echo esc_html_x( '“Études has saved us thousands of hours of work and has unlocked insights we never thought possible.”', 'Testimonial Text or Review Text Got From the Person', 'twentytwentyfour' ); ?></em></p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","width":64,"height":64,"scale":"cover","sizeSlug":"thumbnail","linkDestination":"none","style":{"border":{"radius":"999px"}},"className":"is-style-rounded"} -->
Expand Down
3 changes: 3 additions & 0 deletions theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,9 @@
"fontWeight": "500"
}
},
"core/paragraph": {
"css": "&.is-style-heading {font-family: var(--wp--preset--font-family--cardo)}"
},
"core/post-author": {
"typography": {
"fontSize": "var(--wp--preset--font-size--small)"
Expand Down
Loading