Skip to content

Commit

Permalink
release: new version
Browse files Browse the repository at this point in the history
- fix markup and structure for patterns, parts & templates
- enable root padding and add padding preset
- remove legacy code
  • Loading branch information
abaicus authored Jan 10, 2023
2 parents 61b17a5 + cb64e66 commit ca096dc
Show file tree
Hide file tree
Showing 14 changed files with 235 additions and 194 deletions.
34 changes: 0 additions & 34 deletions assets/css/src/common/_generic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,3 @@ footer {
.wp-block-spacer {
margin-block-start: 0 !important;
}

/*
* Alignment styles.
*
* Relevant issues:
* https://github.com/WordPress/gutenberg/issues/35607
* https://github.com/WordPress/gutenberg/issues/35884
*/

.wp-site-blocks,
body > .is-root-container,
.edit-post-visual-editor__post-title-wrapper,
.wp-block-group.alignfull,
.wp-block-group.has-background,
.wp-block-cover.alignfull,
.is-root-container .wp-block[data-align="full"] > .wp-block-group,
.is-root-container .wp-block[data-align="full"] > .wp-block-cover {
padding-left: var(--wp--custom--spacing--outer);
padding-right: var(--wp--custom--spacing--outer);
}

.wp-site-blocks .alignfull,
.wp-site-blocks > .wp-block-group.has-background,
.wp-site-blocks > .wp-block-cover,
.wp-site-blocks > .wp-block-template-part > .wp-block-group.has-background,
.wp-site-blocks > .wp-block-template-part > .wp-block-cover,
body > .is-root-container > .wp-block-cover,
body > .is-root-container > .wp-block-template-part > .wp-block-group.has-background,
body > .is-root-container > .wp-block-template-part > .wp-block-cover,
.is-root-container .wp-block[data-align="full"] {
margin-left: calc(-1 * var(--wp--custom--spacing--outer)) !important;
margin-right: calc(-1 * var(--wp--custom--spacing--outer)) !important;
width: unset;
}
3 changes: 3 additions & 0 deletions inc/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ private function run_hooks() {
public function setup() {
load_theme_textdomain( 'jaxon', JAXON_DIR . '/languages' );

$starter_content = new Starter_Content();

add_theme_support( 'starter-content', $starter_content->get() );
add_theme_support( 'wp-block-styles' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'title-tag' );
Expand Down
67 changes: 67 additions & 0 deletions inc/Starter_Content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php
/**
* Starter content.
*
* @author Themeisle
* @package jaxon
* @since 1.0.1
*/

namespace Jaxon;

/**
* Class Starter Content
*
* @package fork
*/
class Starter_Content {
const HOME_SLUG = 'home';
const BLOG_SLUG = 'blog';

/**
* Get the starter content.
*
* @return array
*/
public function get() {
return array(
'nav_menus' => array(
'primary' => array(
'items' => array(
'home' => array(
'type' => 'post_type',
'object' => 'page',
'object_id' => '{{' . self::HOME_SLUG . '}}',
),
'page_blog' => array(
'type' => 'post_type',
'object' => 'page',
'object_id' => '{{' . self::BLOG_SLUG . '}}',
),
),
),
),
'options' => array(
'page_on_front' => '{{' . self::HOME_SLUG . '}}',
'page_for_posts' => '{{' . self::BLOG_SLUG . '}}',
'show_on_front' => 'page',
),
'posts' => array(
self::BLOG_SLUG => array(
'post_name' => self::BLOG_SLUG,
'post_type' => 'page',
'post_title' => self::BLOG_SLUG,
),
self::HOME_SLUG => array(
'post_type' => 'page',
'post_title' => self::HOME_SLUG,
'post_content' => '
<!-- wp:paragraph {"align":"center"} -->
<p class="has-text-align-center">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.</p>
<!-- /wp:paragraph -->
',
),
),
);
}
}
54 changes: 22 additions & 32 deletions inc/patterns/row-with-logos.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,34 @@

use Jaxon\Assets_Manager;

$logos = array(
Assets_Manager::get_image_url( 'jaxon-placeholder-logo-05.1.2.svg' ),
Assets_Manager::get_image_url( 'jaxon-placeholder-logo-04.1.2.svg' ),
Assets_Manager::get_image_url( 'jaxon-placeholder-logo-01.1.2.svg' ),
Assets_Manager::get_image_url( 'jaxon-placeholder-logo-02.1.2.svg' ),
Assets_Manager::get_image_url( 'jaxon-placeholder-logo-03.1.2.svg' ),
);

$logo_markup = '
<!-- wp:image {"align":"center","sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image aligncenter size-full is-resized"><img src="%s"/></figure>
<!-- /wp:image -->
';

$logos_markup = '';

foreach ( $logos as $logo ) {
$logos_markup .= sprintf( $logo_markup, esc_url( $logo ) );
}

return array(
'title' => __( 'Row with logos', 'jaxon' ),
'categories' => array( 'jaxon' ),
'content' => '
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"40px","bottom":"40px","right":"0"},"blockGap":"var:preset|spacing|80","margin":{"top":"0px","bottom":"0px"}}},"backgroundColor":"ti-accent","textColor":"ti-fg-alt","layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull has-ti-fg-alt-color has-ti-accent-background-color has-text-color has-background" style="margin-top:0px;margin-bottom:0px;padding-top:40px;padding-right:0;padding-bottom:40px"><!-- wp:columns {"verticalAlignment":"center","align":"wide"} -->
<div class="wp-block-columns alignwide are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center"} -->
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:image {"width":134,"height":35,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full is-resized"><img src="' . esc_url( Assets_Manager::get_image_url( 'jaxon-placeholder-logo-05.1.2.svg' ) ) . '" width="134" height="35"/></figure>
<!-- /wp:image --></div>
<!-- /wp:column -->
<!-- wp:column {"verticalAlignment":"center"} -->
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:image {"width":108,"height":27,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full is-resized"><img src="' . esc_url( Assets_Manager::get_image_url( 'jaxon-placeholder-logo-04.1.2.svg' ) ) . '" width="108" height="27"/></figure>
<!-- /wp:image --></div>
<!-- /wp:column -->
<!-- wp:column {"verticalAlignment":"center"} -->
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:image {"width":140,"height":36,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full is-resized"><img src="' . esc_url( Assets_Manager::get_image_url( 'jaxon-placeholder-logo-01.1.2.svg' ) ) . '" width="140" height="36"/></figure>
<!-- /wp:image --></div>
<!-- /wp:column -->
<!-- wp:column {"verticalAlignment":"center"} -->
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:image {"width":149,"height":45,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full is-resized"><img src="' . esc_url( Assets_Manager::get_image_url( 'jaxon-placeholder-logo-02.1.2.svg' ) ) . '" width="149" height="45"/></figure>
<!-- /wp:image --></div>
<!-- /wp:column -->
<!-- wp:column {"verticalAlignment":"center"} -->
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:image {"width":137,"height":36,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full is-resized"><img src="' . esc_url( Assets_Manager::get_image_url( 'jaxon-placeholder-logo-03.1.2.svg' ) ) . '" width="137" height="36"/></figure>
<!-- /wp:image --></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"40px","right":"var:preset|spacing|20","bottom":"40px","left":"var:preset|spacing|20"}}},"backgroundColor":"ti-accent","layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull has-ti-accent-background-color has-background" style="padding-top:40px;padding-right:var(--wp--preset--spacing--20);padding-bottom:40px;padding-left:var(--wp--preset--spacing--20)"><!-- wp:group {"align":"wide","layout":{"type":"flex","flexWrap":"wrap","justifyContent":"space-between"}} -->
<div class="wp-block-group alignwide">' . $logos_markup . '</div>
<!-- /wp:group --></div>
<!-- /wp:group -->
',
);
Expand Down
Loading

0 comments on commit ca096dc

Please sign in to comment.