Skip to content

Commit

Permalink
2024 Theme: Make heading styles consistent across all templates
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwoodnz committed Jun 19, 2024
1 parent 09d8faa commit 19cca2e
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|40","bottom":"var:preset|spacing|30"},"blockGap":"var:preset|spacing|30"}},"layout":{"type":"flex","flexWrap":"wrap","verticalAlignment":"bottom"}} -->
<div class="wp-block-group alignwide" style="padding-top:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--30)">

<!-- wp:heading {"level":1,"style":{"typography":{"fontSize":"50px","fontStyle":"normal","fontWeight":"400"}},"fontFamily":"eb-garamond"} -->
<h1 class="wp-block-heading has-eb-garamond-font-family" style="font-size:50px;font-style:normal;font-weight:400"><?php esc_html_e( 'Learn WordPress', 'wporg-learn' ); ?></h1>
<!-- wp:heading {"level":1,"style":{"typography":{"fontSize":"50px"}}} -->
<h1 class="wp-block-heading" style="font-size:50px"><?php esc_html_e( 'Learn WordPress', 'wporg-learn' ); ?></h1>
<!-- /wp:heading -->

<!-- wp:paragraph {"style":{"typography":{"lineHeight":"2.3"}},"textColor":"white"} -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
use function WPOrg_Learn\Sensei\{get_my_courses_page_url}
?>

<!-- wp:paragraph {"style":{"spacing":{"margin":{"top":"0"}}}} -->
<p style="margin-top:0"><?php esc_html_e( 'Dive into our learning pathways which will take you from beginner to expert at your own pace.', 'wporg-learn' ); ?></p>
<!-- wp:heading {"level":1} -->
<h1 class="wp-block-heading"><?php esc_html_e( 'Learning Pathways', 'wporg-learn' ); ?></h1>
<!-- /wp:heading -->

<!-- wp:paragraph {"style":{"spacing":{"margin":{"top":"var:preset|spacing|10"}}}} -->
<p style="margin-top:var(--wp--preset--spacing--10)"><?php esc_html_e( 'Dive into our learning pathways which will take you from beginner to expert at your own pace.', 'wporg-learn' ); ?></p>
<!-- /wp:paragraph -->

<!-- wp:buttons {"style":{"spacing":{"margin":{"bottom":"var:preset|spacing|50"}}}} -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<!-- wp:group {"style":{"spacing":{"margin":{"bottom":"var:preset|spacing|50"}}},"layout":{"type":"constrained","justifyContent":"left","contentSize":"730px"}} -->
<div class="wp-block-group" style="margin-bottom:var(--wp--preset--spacing--50)">

<!-- wp:heading {"level":1} -->
<h1 class="wp-block-heading"><?php esc_html_e( 'Online Workshops', 'wporg-learn' ); ?></h1>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><?php esc_html_e( 'Online workshops are live sessions where you can learn alongside other WordPress enthusiasts. They are a safe zone where you can come as you are, develop new ideas, explore issues, ask questions, network over shared interests, exchange theories, collaborate on work, and thrive in uncertainty.', 'wporg-learn' ); ?></p>
<!-- /wp:paragraph -->
Expand Down
14 changes: 12 additions & 2 deletions wp-content/themes/pub/wporg-learn-2024/patterns/search-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@

?>

<!-- wp:group {"style":{"spacing":{"margin":{"bottom":"var:preset|spacing|50"}}},"layout":{"type":"constrained","justifyContent":"left","contentSize":"730px"}} -->
<div class="wp-block-group" style="margin-bottom:var(--wp--preset--spacing--50)">

<!-- wp:heading {"level":1} -->
<h1 class="wp-block-heading"><?php esc_html_e( 'Search results', 'wporg-learn' ); ?></h1>
<!-- /wp:heading -->

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

<!-- wp:group {"align":"wide","layout":{"type":"flex","flexWrap":"wrap","justifyContent":"space-between"},"style":{"spacing":{"margin":{"top":"0","bottom":"var:preset|spacing|50"}}}} -->
<div class="wp-block-group alignwide" style="margin-top:0;margin-bottom:var(--wp--preset--spacing--50)">

Expand Down Expand Up @@ -56,8 +66,8 @@

<!-- wp:query-no-results -->

<!-- wp:heading {"level":1,"fontFamily":"eb-garamond"} -->
<h1 class="wp-block-heading has-eb-garamond-font-family"><?php esc_html_e( 'No results found', 'wporg-learn' ); ?></h1>
<!-- wp:heading {"level":2} -->
<h2 class="wp-block-heading"><?php esc_html_e( 'No results found', 'wporg-learn' ); ?></h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"placeholder":"Add text or blocks that will display when a query returns no results."} -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ function render( $attributes, $content, $block ) {
return '';
}

$learning_pathway_id = $learning_pathway_object->term_id;
$learning_pathway_name = $learning_pathway_object->name;
$learning_pathway_description = $learning_pathway_object->description;

$content = '<!-- wp:group {"className":"wp-block-wporg-learn-learning-pathway-header-content","align":"full","style":{"spacing":{"padding":{"right":"var:preset|spacing|edge-space","left":"var:preset|spacing|edge-space","top":"0","bottom":"0"}},"border":{"bottom":{"color":"var:preset|color|light-grey-1","width":"1px"}}},"backgroundColor":"' . esc_attr( $learning_pathway_slug ) . '","layout":{"type":"constrained"}} -->
<div class="wp-block-wporg-learn-learning-pathway-header-content wp-block-group alignfull has-' . esc_attr( $learning_pathway_slug ) . '-background-color has-background" style="border-bottom-color:var(--wp--preset--color--light-grey-1);border-bottom-width:1px;padding-top:0;padding-right:var(--wp--preset--spacing--edge-space);padding-bottom:0;padding-left:var(--wp--preset--spacing--edge-space)">
Expand All @@ -62,12 +58,10 @@ function render( $attributes, $content, $block ) {
<!-- wp:group {"style":{"spacing":{"padding":{"top":"var:preset|spacing|60","bottom":"var:preset|spacing|60"}},"layout":{"selfStretch":"fill","flexSize":null}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group" style="padding-top:var(--wp--preset--spacing--60);padding-bottom:var(--wp--preset--spacing--60)">
<!-- wp:heading {"level":1,"fontSize":"heading-1","fontFamily":"eb-garamond"} -->
<h1 class="wp-block-heading has-eb-garamond-font-family has-heading-1-font-size">' . esc_html( $learning_pathway_name ) . '</h1>
<!-- /wp:heading -->
<!-- wp:query-title {"type":"archive","showPrefix":false} /-->
<!-- wp:paragraph {"style":{"typography":{"lineHeight":1.6}}} -->
<p style="line-height:1.6">' . esc_html( $learning_pathway_description ) . '</p>
<p style="line-height:1.6">' . esc_html( $learning_pathway_object->description ) . '</p>
<!-- /wp:paragraph -->
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"left":"var:preset|spacing|edge-space","right":"var:preset|spacing|edge-space","top":"var:preset|spacing|40","bottom":"var:preset|spacing|40"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull" style="padding-top:var(--wp--preset--spacing--40);padding-right:var(--wp--preset--spacing--edge-space);padding-bottom:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--edge-space)">

<!-- wp:post-title {"level":1,"style":{"spacing":{"margin":{"bottom":"var:preset|spacing|10"}}}} /-->

<!-- wp:pattern {"slug":"wporg-learn-2024/page-learning-pathways-content"} /-->

<!-- wp:wporg-learn/learning-pathway-cards {"style":{"spacing":{"margin":{"top":"var:preset|spacing|40"}}}} /-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"left":"var:preset|spacing|edge-space","right":"var:preset|spacing|edge-space","top":"var:preset|spacing|50","bottom":"var:preset|spacing|50"}}},"layout":{"type":"constrained","contentSize":"1160px"}} -->
<div class="wp-block-group alignfull" style="padding-top:var(--wp--preset--spacing--50);padding-right:var(--wp--preset--spacing--edge-space);padding-bottom:var(--wp--preset--spacing--50);padding-left:var(--wp--preset--spacing--edge-space)">

<!-- wp:post-title {"level":1} /-->

<!-- wp:pattern {"slug":"wporg-learn-2024/page-online-workshops-content"} /-->

</div>
Expand Down
28 changes: 20 additions & 8 deletions wp-content/themes/pub/wporg-learn-2024/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
},
"level-1": {
"typography": {
"lineHeight": 1.2
"fontFamily": "var(--wp--preset--font-family--eb-garamond)",
"fontSize": "36px",
"lineHeight": 1.3,
"fontWeight": 400
},
"breakpoint": {
"small-only": {
Expand Down Expand Up @@ -167,21 +170,30 @@
"blocks": {
"core/post-title": {
"typography": {
"fontFamily": "var(--wp--preset--font-family--eb-garamond)",
"fontSize": "36px",
"lineHeight": "1.3"
"fontFamily": "var(--wp--custom--heading--level-1--typography--font-family)",
"fontSize": "var(--wp--custom--heading--level-1--typography--font-size)",
"lineHeight": "var(--wp--custom--heading--level-1--typography--line-height)",
"fontWeight": "var(--wp--custom--heading--level-1--typography--font-weight)"
}
},
"core/query-title": {
"typography": {
"fontFamily": "var(--wp--preset--font-family--eb-garamond)",
"fontSize": "36px",
"lineHeight": "1.3",
"fontWeight": "400"
"fontFamily": "var(--wp--custom--heading--level-1--typography--font-family)",
"fontSize": "var(--wp--custom--heading--level-1--typography--font-size)",
"lineHeight": "var(--wp--custom--heading--level-1--typography--line-height)",
"fontWeight": "var(--wp--custom--heading--level-1--typography--font-weight)"
}
}
},
"elements": {
"h1": {
"typography": {
"fontFamily": "var(--wp--custom--heading--level-1--typography--font-family)",
"fontSize": "var(--wp--custom--heading--level-1--typography--font-size)",
"lineHeight": "var(--wp--custom--heading--level-1--typography--line-height)",
"fontWeight": "var(--wp--custom--heading--level-1--typography--font-weight)"
}
},
"h2": {
"typography": {
"fontSize": "var(--wp--preset--font-size--heading-4)",
Expand Down

0 comments on commit 19cca2e

Please sign in to comment.