From fe472c1bcf997ed850175c4d8ace03e4897cd232 Mon Sep 17 00:00:00 2001 From: abaicus Date: Tue, 10 Jan 2023 15:15:16 +0200 Subject: [PATCH 1/4] fix: markup and structure for patterns, parts & templates --- inc/patterns/row-with-logos.php | 54 ++++---- parts/footer.html | 213 ++++++++++++++++---------------- parts/header.html | 30 ++--- templates/404.html | 2 +- templates/archive.html | 2 +- templates/front-page.html | 5 +- templates/index.html | 2 +- templates/page.html | 2 +- templates/search.html | 2 +- templates/single.html | 4 +- 10 files changed, 156 insertions(+), 160 deletions(-) diff --git a/inc/patterns/row-with-logos.php b/inc/patterns/row-with-logos.php index d1c3519..6cbb1b9 100644 --- a/inc/patterns/row-with-logos.php +++ b/inc/patterns/row-with-logos.php @@ -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 = ' + +
+ +'; +$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' => ' - -
-
-
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
- - - -
-
-
-
-
+ +
+
' . $logos_markup . '
+
', ); diff --git a/parts/footer.html b/parts/footer.html index 94102b3..c696427 100644 --- a/parts/footer.html +++ b/parts/footer.html @@ -1,113 +1,118 @@ - -
- -
- -
- + +
+ +
+ - -
- -
- -
Company
- - - - - - - -
- - - -
- -
Limited Offers
- - - - - - - -
- - - -
- -
Collections
- - - - - - - -
- - - -
- -
Fashion Tips
- - - - - - - + + - - - -
- -
Support
- - - - - - - -
- -
- - - -
- - - -
- -
- -

- Jaxon

- + + + +
+ +
+ +
Company
+ + + + + + + +
+ + + +
+ +
Limited Offers
+ + + + + + + +
+ + + +
+ +
Collections
+ + + + + + + +
+ + + +
+ +
Fashion Tips
+ + + + + + + +
+ + + +
+ +
Support
+ + + + + + + +
+
- + + + +
+ + + +
+ +
+ +

+ Jaxon

+ +
+ - -
- - + +
+
diff --git a/parts/header.html b/parts/header.html index 8ff4d29..86ee848 100644 --- a/parts/header.html +++ b/parts/header.html @@ -1,19 +1,21 @@ - -
- - -
- - - - - - - - + +
+ +
+ +
+ + + + + + + +
+
-
\ No newline at end of file diff --git a/templates/404.html b/templates/404.html index 09dd20b..b76c56e 100644 --- a/templates/404.html +++ b/templates/404.html @@ -1,5 +1,5 @@ - +
diff --git a/templates/archive.html b/templates/archive.html index bfe5bde..0dcda42 100644 --- a/templates/archive.html +++ b/templates/archive.html @@ -1,5 +1,5 @@ - +
diff --git a/templates/front-page.html b/templates/front-page.html index b6961a9..d9136d7 100644 --- a/templates/front-page.html +++ b/templates/front-page.html @@ -1,6 +1,6 @@ - -
+ +
@@ -16,7 +16,6 @@ -
diff --git a/templates/index.html b/templates/index.html index a9b1e6b..937be1e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,5 +1,5 @@ - +
diff --git a/templates/page.html b/templates/page.html index 8a451f6..73de17e 100644 --- a/templates/page.html +++ b/templates/page.html @@ -1,5 +1,5 @@ - +
diff --git a/templates/search.html b/templates/search.html index 1506b20..81c27a3 100644 --- a/templates/search.html +++ b/templates/search.html @@ -1,5 +1,5 @@ - +
diff --git a/templates/single.html b/templates/single.html index 3ee7f5f..b784879 100644 --- a/templates/single.html +++ b/templates/single.html @@ -1,6 +1,6 @@ - -
+ +
Date: Tue, 10 Jan 2023 15:15:32 +0200 Subject: [PATCH 2/4] fix: adds starter content --- inc/Core.php | 3 ++ inc/Starter_Content.php | 67 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 inc/Starter_Content.php diff --git a/inc/Core.php b/inc/Core.php index 024740c..bfae19b 100644 --- a/inc/Core.php +++ b/inc/Core.php @@ -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' ); diff --git a/inc/Starter_Content.php b/inc/Starter_Content.php new file mode 100644 index 0000000..2437855 --- /dev/null +++ b/inc/Starter_Content.php @@ -0,0 +1,67 @@ + 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' => ' + +

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.

+ + ', + ), + ), + ); + } +} From 0f9cbe35f2470c9978de1a8a67a2241766c1816e Mon Sep 17 00:00:00 2001 From: abaicus Date: Tue, 10 Jan 2023 15:15:45 +0200 Subject: [PATCH 3/4] feat: enable root padding and add padding preset --- theme.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/theme.json b/theme.json index 98face4..4b32cf2 100644 --- a/theme.json +++ b/theme.json @@ -1,6 +1,7 @@ { "version": 2, "settings": { + "useRootPaddingAwareAlignments": true, "appearanceTools": true, "color": { "palette": [ @@ -434,6 +435,14 @@ "fontSize": "var(--wp--preset--font-size--large)" } } + }, + "spacing": { + "padding": { + "top": "0", + "right": "var(--wp--preset--spacing--30)", + "bottom": "0", + "left": "var(--wp--preset--spacing--30)" + } } }, "templateParts": [ From 57a543e402155dddf8c0f2ccf1218d41d6ad5c36 Mon Sep 17 00:00:00 2001 From: abaicus Date: Tue, 10 Jan 2023 15:17:03 +0200 Subject: [PATCH 4/4] chore: remove legacy code needed before 6.0.3 --- assets/css/src/common/_generic.scss | 34 ----------------------------- 1 file changed, 34 deletions(-) diff --git a/assets/css/src/common/_generic.scss b/assets/css/src/common/_generic.scss index f8d8da2..ce8972b 100644 --- a/assets/css/src/common/_generic.scss +++ b/assets/css/src/common/_generic.scss @@ -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; -}