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

Add: Services - Two-column boxed pricing table #165

Merged
merged 10 commits into from
Sep 4, 2024
25 changes: 25 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,28 @@ function twentytwentyfive_enqueue_styles() {
);
}
add_action( 'wp_enqueue_scripts', 'twentytwentyfive_enqueue_styles' );

/**
* Register custom block styles
*
* @since Twenty Twenty-Five 1.0
* @return void
*/
function twentytwentyfive_block_styles() {
register_block_style(
'core/list',
array(
'name' => 'checkmark-list',
'label' => __( 'Checkmark', 'twentytwentyfive' ),
'inline_style' => '
ul.is-style-checkmark-list {
list-style-type: "\2713";
}

ul.is-style-checkmark-list li {
padding-inline-start: 1ch;
}',
)
);
}
add_action( 'init', 'twentytwentyfive_block_styles' );
137 changes: 137 additions & 0 deletions patterns/cta-pricing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<?php
/**
* Title: Pricing two columns
* Slug: twentytwentyfive/cta-pricing
* Categories: call-to-action, featured
* Viewport width: 1400
* Description: A pricing section with a title, a paragraph and two pricing levels.
*
* @package WordPress
* @subpackage Twenty_Twenty_Five
* @since Twenty Twenty-Five 1.0
*/

?>
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|60","bottom":"var:preset|spacing|60"},"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--60);padding-bottom:var(--wp--preset--spacing--60)">
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"var:preset|spacing|50"}}},"layout":{"type":"flex","orientation":"vertical","justifyContent":"center"}} -->
<div class="wp-block-group alignwide" style="padding-bottom:var(--wp--preset--spacing--50)">
<!-- wp:heading {"textAlign":"center","align":"wide"} -->
<h2 class="wp-block-heading alignwide has-text-align-center">Pricing</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"center"} -->
<p class="has-text-align-center">These are our membership options. You can cancel or pause anytime.</p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:group -->

<!-- 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 {"width":"9%"} -->
<div class="wp-block-column" style="flex-basis:9%">
<!-- wp:spacer {"height":"var:preset|spacing|30"} -->
<div style="height:var(--wp--preset--spacing--30)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
</div>
<!-- /wp:column -->

<!-- wp:column {"style":{"spacing":{"padding":{"top":"var:preset|spacing|50","right":"var:preset|spacing|50","bottom":"var:preset|spacing|50","left":"var:preset|spacing|50"}},"border":{"width":"1px","color":"var:preset|color|opacity-20","radius":"10px"}}} -->
<div class="wp-block-column has-border-color" style="border-color:var(--wp--preset--color--opacity-20);border-width:1px;border-radius:10px;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:heading {"level":3} -->
<h3 class="wp-block-heading" id="free">Free</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"style":{"elements":{"link":{"color":{"text":"var:preset|color|primary"}}}},"textColor":"primary","fontSize":"large"} -->
Copy link
Contributor

Choose a reason for hiding this comment

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

This text color needs to be removed to make it consistent with the second pricing option and to make it work with the section styles.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for reviewing, Carolina!

I followed the design, where that particular color is used for that element

Screenshot 2024-09-02 at 09 46 57

Copy link
Contributor

Choose a reason for hiding this comment

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

It does not work with the style variations:
image

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it does not look well. We may want to update the "secondary" in some variations, or not use it in this pattern. I'll defer this to @beafialho

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you! We can use the Primary color on the 0€

<p class="has-primary-color has-text-color has-link-color has-large-font-size">0€</p>
<!-- /wp:paragraph -->

<!-- wp:list {"className":"is-style-checkmark-list","style":{"spacing":{"padding":{"left":"var:preset|spacing|20","bottom":"var:preset|spacing|20"}}},"fontSize":"small"} -->
<ul style="padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)" class="wp-block-list has-small-font-size is-style-checkmark-list">
<!-- wp:list-item -->
<li>Get access to our paid articles and weekly newsletter.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Join our IRL events.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Get a free tote bag.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>An elegant addition of home decor collection.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Join our forums.</li>
<!-- /wp:list-item -->
</ul>
<!-- /wp:list -->

<!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} -->
<div class="wp-block-buttons">
<!-- wp:button {"width":100} -->
<div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link wp-element-button">Join</a></div>
<!-- /wp:button -->
</div>
<!-- /wp:buttons -->
</div>
<!-- /wp:column -->

<!-- wp:column {"style":{"spacing":{"padding":{"top":"var:preset|spacing|50","right":"var:preset|spacing|50","bottom":"var:preset|spacing|50","left":"var:preset|spacing|50"}},"border":{"width":"1px","color":"var:preset|color|opacity-20","radius":"10px"}},"layout":{"type":"default"}} -->
<div class="wp-block-column has-border-color" style="border-color:var(--wp--preset--color--opacity-20);border-width:1px;border-radius:10px;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:heading {"level":3} -->
<h3 class="wp-block-heading" id="single">Single</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"fontSize":"large"} -->
<p class="has-large-font-size">20€/month</p>
<!-- /wp:paragraph -->

<!-- wp:list {"className":"is-style-checkmark-list","style":{"spacing":{"padding":{"bottom":"var:preset|spacing|20","left":"var:preset|spacing|20"}}},"fontSize":"small"} -->
<ul style="padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--20)" class="wp-block-list has-small-font-size is-style-checkmark-list">
<!-- wp:list-item -->
<li>Get access to our paid articles and weekly newsletter.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Join our IRL events.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Get a free tote bag.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>An elegant addition of home decor collection.</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Join our forums.</li>
<!-- /wp:list-item -->
</ul>
<!-- /wp:list -->

<!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} -->
<div class="wp-block-buttons">
<!-- wp:button {"width":100} -->
<div class="wp-block-button has-custom-width wp-block-button__width-100"><a class="wp-block-button__link wp-element-button">Join</a></div>
<!-- /wp:button -->
</div>
<!-- /wp:buttons -->
</div>
<!-- /wp:column -->

<!-- wp:column {"width":"9%"} -->
<div class="wp-block-column" style="flex-basis:9%">
<!-- wp:spacer {"height":"var:preset|spacing|30"} -->
<div style="height:var(--wp--preset--spacing--30)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
</div>
<!-- /wp:column -->
</div>
<!-- /wp:columns -->
</div>
<!-- /wp:group -->
4 changes: 2 additions & 2 deletions patterns/services-three-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","bottom":"var:preset|spacing|50"},"blockGap":"var:preset|spacing|50"}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull" style="padding-top:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50)">
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50"},"blockGap":"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-bottom:var(--wp--preset--spacing--50)">
<!-- wp:heading {"align":"wide"} -->
<h2 class="wp-block-heading alignwide">Our services</h2>
<!-- /wp:heading -->
Expand Down
Loading