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

Try: Add 3 section styles, update Hero: Centered Heading pattern. #151

Merged
merged 3 commits into from
Aug 30, 2024
Merged
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
6 changes: 3 additions & 3 deletions patterns/contact-location-and-link.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
*/

?>
<!-- wp:group {"align":"full","style":{"spacing":{"margin":{"top":"0","bottom":"0"},"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50","left":"var:preset|spacing|50","right":"var:preset|spacing|50"}}},"backgroundColor":"accent-1","layout":{"type":"constrained","justifyContent":"center"}} -->
<div class="wp-block-group alignfull has-accent-1-background-color has-background" 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":"full","className":"is-style-section-3","style":{"spacing":{"margin":{"top":"0","bottom":"0"},"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50","left":"var:preset|spacing|50","right":"var:preset|spacing|50"}}},"layout":{"type":"constrained","justifyContent":"center"}} -->
<div class="wp-block-group alignfull is-style-section-3" 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:columns {"align":"wide","style":{"spacing":{"blockGap":{"top":"var:preset|spacing|40","left":"var:preset|spacing|50"}}}} -->
<div class="wp-block-columns alignwide">
<!-- wp:column {"verticalAlignment":"top","width":""} -->
Expand All @@ -39,5 +39,5 @@
<!-- /wp:column -->
</div>
<!-- /wp:columns -->
</div>
</div>
<!-- /wp:group -->
4 changes: 2 additions & 2 deletions patterns/hero-centered-heading.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<div class="wp-block-group alignfull" style="min-height:0vh;margin-top:0;margin-bottom:0;padding-top:var(--wp--preset--spacing--70);padding-right:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--70);padding-left:var(--wp--preset--spacing--40);">
<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|40"}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group">
<!-- wp:heading {"textAlign":"center","level":1,"style":{"spacing":{"margin":{"right":"0","left":"0"},"padding":{"right":"0","left":"0"}},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}}},"textColor":"contrast"} -->
<h1 class="wp-block-heading has-text-align-center has-contrast-color has-text-color has-link-color" style="margin-right:0;margin-left:0;padding-right:0;padding-left:0">Tell your story</h1>
<!-- wp:heading {"textAlign":"center","level":1,"style":{"spacing":{"margin":{"right":"0","left":"0"},"padding":{"right":"0","left":"0"}}}} -->
Copy link
Contributor Author

@jasmussen jasmussen Aug 29, 2024

Choose a reason for hiding this comment

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

@juanfra let me know if it was intentional to explicitly set the heading color here.

Copy link
Member

Choose a reason for hiding this comment

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

No, it was not intentional.

<h1 class="wp-block-heading has-text-align-center" style="margin-right:0;margin-left:0;padding-right:0;padding-left:0">Tell your story</h1>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"center"} -->
Expand Down
4 changes: 2 additions & 2 deletions patterns/two-headings-and-a-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

<!-- wp:column {"verticalAlignment":"center","width":"50%"} -->
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:50%">
<!-- wp:heading {"level":4,"style":{"typography":{"textTransform":"uppercase"}},"textColor":"primary","fontSize":"small"} -->
<h4 class="wp-block-heading has-primary-color has-text-color has-small-font-size" style="text-transform:uppercase"><?php esc_html_e( 'What will happen at “Stories, historias, iсторії, iστορίες”:', 'twentytwentyfive' ); ?></h4>
<!-- wp:heading {"level":4,"style":{"typography":{"textTransform":"uppercase"}},"fontSize":"small"} -->
<h4 class="wp-block-heading has-small-font-size" style="text-transform:uppercase"><?php esc_html_e( 'What will happen at “Stories, historias, iсторії, iστορίες”:', 'twentytwentyfive' ); ?></h4>
<!-- /wp:heading -->

<!-- wp:list {"style":{"spacing":{"padding":{"right":"var:preset|spacing|40","left":"var:preset|spacing|40"}}},"fontSize":"small"} -->
Expand Down
37 changes: 37 additions & 0 deletions styles/blocks/section-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3,
"slug": "section-1",
"title": "Style 1",
"blockTypes": [
"core/group",
"core/columns",
"core/column"
],
"styles": {
"color": {
"background": "var(--wp--preset--color--accent-2)",
"text": "var(--wp--preset--color--contrast)"
},
"blocks": {
"core/separator": {
"color": {
"text": "color-mix(in srgb, currentColor 25%, transparent)"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@carolinan @beafialho Let me know if I got this right! I only found a few separator designs in the Figma.

}
}
},
"elements": {
"button": {
"color": {
"background": "var(--wp--preset--color--contrast)",
"text": "var(--wp--preset--color--base)"
}
},
"link": {
"color": {
"text": "var(--wp--preset--color--contrast)"
Copy link
Member

Choose a reason for hiding this comment

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

I think we could remove this, if we used currentColor in the parent theme.json.

Copy link
Member

Choose a reason for hiding this comment

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

Otherwise if the user changes the text color, they'll also need to also change the link color.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah, good call!

}
}
}
}
}
37 changes: 37 additions & 0 deletions styles/blocks/section-2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3,
"slug": "section-2",
"title": "Style 2",
"blockTypes": [
"core/group",
"core/columns",
"core/column"
],
"styles": {
"color": {
"background": "var(--wp--preset--color--accent-3)",
"text": "var(--wp--preset--color--accent-2)"
},
"blocks": {
"core/separator": {
"color": {
"text": "color-mix(in srgb, currentColor 25%, transparent)"
}
}
},
"elements": {
"button": {
"color": {
"background": "var(--wp--preset--color--contrast)",
"text": "var(--wp--preset--color--base)"
}
},
"link": {
"color": {
"text": "var(--wp--preset--color--accent-2)"
}
}
}
}
}
37 changes: 37 additions & 0 deletions styles/blocks/section-3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3,
"slug": "section-3",
"title": "Style 3",
"blockTypes": [
"core/group",
"core/columns",
"core/column"
],
"styles": {
"color": {
"background": "var(--wp--preset--color--accent-1)",
"text": "var(--wp--preset--color--contrast)"
},
"blocks": {
"core/separator": {
"color": {
"text": "color-mix(in srgb, currentColor 25%, transparent)"
}
}
},
"elements": {
"button": {
"color": {
"background": "var(--wp--preset--color--contrast)",
"text": "var(--wp--preset--color--base)"
}
},
"link": {
"color": {
"text": "var(--wp--preset--color--contrast)"
}
}
}
}
}
Loading