Skip to content
Open
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
1 change: 0 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ Do not add new blocks to this repo. New blocks should be added to `newspack-plug
- **External patterns are intentionally blocked.** The theme prevents Jetpack, WooCommerce, and Automattic remote patterns from loading. This is by design — do not remove these filters.
- **After adding a new PHP class file, run `composer dump-autoload`.** The `includes/` directory uses classmap autoloading, not PSR-4.
- **The Article Subtitle block has two completely different implementations.** In the post editor it is not a block at all — it injects a `contenteditable` div directly into the DOM and updates post meta via `editPost()`. In the site editor it registers normally via `registerBlockType()`. Modifying it requires understanding which context you are in.
- **There are two separate menu systems with different selectors.** Mobile headers use `.header-mobile` (container), `.mobile-menu__toggle` / `.mobile-menu__contents` (handled by `menus/mobile.js`). Drawer menus used in some desktop header patterns use `.drawer-menu` (container), `.drawer-menu__toggle` / `.drawer-menu__contents` (handled by `menus/drawer.js`). Mixing up the selectors or JS handlers will silently break menu initialization.
- **Style variations require a unique `className` in their JSON.** The theme reads `wp_get_global_settings()['custom']['className']` and adds it as a `theme-variation-{className}` body class used for CSS scoping. A new style variation in `styles/` must define this value or scoped styles will not apply.
17 changes: 0 additions & 17 deletions parts/drawer-contents.html

This file was deleted.

19 changes: 0 additions & 19 deletions parts/mobile-contents.html

This file was deleted.

7 changes: 0 additions & 7 deletions parts/mobile-menu.html

This file was deleted.

27 changes: 0 additions & 27 deletions patterns/drawer-menu.php

This file was deleted.

7 changes: 6 additions & 1 deletion patterns/header/header-desktop-style-2.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@

<!-- wp:group {"lock":{"move":false,"remove":true},"metadata":{"name":"<?php esc_html_e( 'Menu', 'newspack-block-theme' ); ?>"},"align":"wide","layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"space-between","verticalAlignment":"center"}} -->
<div class="wp-block-group alignwide">
<!-- wp:pattern {"slug":"newspack-block-theme/drawer-menu"} /-->
<!-- wp:newspack/overlay-menu {"instanceId":"fedb5a226df2"} -->
<div class="wp-block-newspack-overlay-menu"><!-- wp:newspack/overlay-menu-trigger {"triggerText":"<?php esc_html_e( 'MENU', 'newspack-block-theme' ); ?>","style":{"color":{"background":"#ffffff00"},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}},"spacing":{"padding":{"top":"var:preset|spacing|20","bottom":"var:preset|spacing|20","left":"var:preset|spacing|20","right":"var:preset|spacing|20"}}},"textColor":"contrast"} /-->
<!-- wp:newspack/overlay-menu-panel -->
<div class="wp-block-newspack-overlay-menu-panel"><!-- wp:navigation {"className":"is-style-flatten","layout":{"type":"flex","setCascadingProperties":true,"orientation":"vertical"}} /--></div>
<!-- /wp:newspack/overlay-menu-panel --></div>
<!-- /wp:newspack/overlay-menu -->

<!-- wp:navigation {"className":"primary-navigation","layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"center","orientation":"horizontal","flexWrap":"wrap"},"style":{"typography":{"textTransform":"uppercase"}}} /-->

Expand Down
7 changes: 6 additions & 1 deletion patterns/header/header-desktop-style-3.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@

<!-- wp:column {"verticalAlignment":"center","width":"25%"} -->
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:25%">
<!-- wp:pattern {"slug":"newspack-block-theme/drawer-menu"} /-->
<!-- wp:newspack/overlay-menu {"instanceId":"fedb5a226df2"} -->
<div class="wp-block-newspack-overlay-menu"><!-- wp:newspack/overlay-menu-trigger {"triggerText":"<?php esc_html_e( 'MENU', 'newspack-block-theme' ); ?>","style":{"color":{"background":"#ffffff00"},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}},"spacing":{"padding":{"top":"var:preset|spacing|20","bottom":"var:preset|spacing|20","left":"var:preset|spacing|20","right":"var:preset|spacing|20"}}},"textColor":"contrast"} /-->
<!-- wp:newspack/overlay-menu-panel -->
<div class="wp-block-newspack-overlay-menu-panel"><!-- wp:navigation {"className":"is-style-flatten","layout":{"type":"flex","setCascadingProperties":true,"orientation":"vertical"}} /--></div>
<!-- /wp:newspack/overlay-menu-panel --></div>
<!-- /wp:newspack/overlay-menu -->
</div>
<!-- /wp:column -->

Expand Down
7 changes: 6 additions & 1 deletion patterns/header/header-desktop-style-4.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
<div class="wp-block-group">
<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group">
<!-- wp:pattern {"slug":"newspack-block-theme/drawer-menu"} /-->
<!-- wp:newspack/overlay-menu {"instanceId":"fedb5a226df2"} -->
<div class="wp-block-newspack-overlay-menu"><!-- wp:newspack/overlay-menu-trigger {"triggerText":"<?php esc_html_e( 'MENU', 'newspack-block-theme' ); ?>","style":{"color":{"background":"#ffffff00"},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}},"spacing":{"padding":{"top":"var:preset|spacing|20","bottom":"var:preset|spacing|20","left":"var:preset|spacing|20","right":"var:preset|spacing|20"}}},"textColor":"contrast"} /-->
<!-- wp:newspack/overlay-menu-panel -->
<div class="wp-block-newspack-overlay-menu-panel"><!-- wp:navigation {"className":"is-style-flatten","layout":{"type":"flex","setCascadingProperties":true,"orientation":"vertical"}} /--></div>
<!-- /wp:newspack/overlay-menu-panel --></div>
<!-- /wp:newspack/overlay-menu -->

<!-- wp:site-logo {"width":256,"lock":{"move":true,"remove":true}} /-->

Expand Down
7 changes: 6 additions & 1 deletion patterns/header/header-mobile-style-1.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@

<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|30"}},"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group">
<!-- wp:template-part {"slug":"mobile-menu","theme":"newspack-block-theme","tagName":"div","lock":{"move":false,"remove":true},"className":"mobile-menu"} /-->
<!-- wp:newspack/overlay-menu {"instanceId":"1a382fccbd5d"} -->
<div class="wp-block-newspack-overlay-menu"><!-- wp:newspack/overlay-menu-trigger {"className":"is-style-icon-only","style":{"color":{"background":"#ffffff00"},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}},"spacing":{"padding":{"right":"0","left":"0"}}},"textColor":"contrast"} /-->
<!-- wp:newspack/overlay-menu-panel -->
<div class="wp-block-newspack-overlay-menu-panel"><!-- wp:navigation {"className":"is-style-flatten","layout":{"type":"flex","setCascadingProperties":true,"orientation":"vertical"}} /--></div>
<!-- /wp:newspack/overlay-menu-panel --></div>
<!-- /wp:newspack/overlay-menu -->

<!-- wp:site-logo {"width":256,"lock":{"move":false,"remove":true}} /-->
</div>
Expand Down
7 changes: 6 additions & 1 deletion patterns/header/header-mobile-style-2.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@

<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|30"}},"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group">
<!-- wp:template-part {"slug":"mobile-menu","theme":"newspack-block-theme","tagName":"div","lock":{"move":false,"remove":true},"className":"mobile-menu"} /-->
<!-- wp:newspack/overlay-menu {"instanceId":"1a382fccbd5d"} -->
<div class="wp-block-newspack-overlay-menu"><!-- wp:newspack/overlay-menu-trigger {"className":"is-style-icon-only","style":{"color":{"background":"#ffffff00"},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}},"spacing":{"padding":{"right":"0","left":"0"}}},"textColor":"contrast"} /-->
<!-- wp:newspack/overlay-menu-panel -->
<div class="wp-block-newspack-overlay-menu-panel"><!-- wp:navigation {"className":"is-style-flatten","layout":{"type":"flex","setCascadingProperties":true,"orientation":"vertical"}} /--></div>
<!-- /wp:newspack/overlay-menu-panel --></div>
<!-- /wp:newspack/overlay-menu -->

<!-- wp:site-logo {"width":256,"lock":{"move":false,"remove":true}} /-->
</div>
Expand Down
7 changes: 6 additions & 1 deletion patterns/header/header-mobile-style-3.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@

<!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|20"},"layout":{"columnSpan":2}},"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group">
<!-- wp:template-part {"slug":"mobile-menu","theme":"newspack-block-theme","tagName":"div","lock":{"move":false,"remove":true},"className":"mobile-menu"} /-->
<!-- wp:newspack/overlay-menu {"instanceId":"1a382fccbd5d"} -->
<div class="wp-block-newspack-overlay-menu"><!-- wp:newspack/overlay-menu-trigger {"className":"is-style-icon-only","style":{"color":{"background":"#ffffff00"},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}},"spacing":{"padding":{"right":"0","left":"0"}}},"textColor":"contrast"} /-->
<!-- wp:newspack/overlay-menu-panel -->
<div class="wp-block-newspack-overlay-menu-panel"><!-- wp:navigation {"className":"is-style-flatten","layout":{"type":"flex","setCascadingProperties":true,"orientation":"vertical"}} /--></div>
<!-- /wp:newspack/overlay-menu-panel --></div>
<!-- /wp:newspack/overlay-menu -->

<?php if ( class_exists( 'Newspack\Reader_Activation' ) && \Newspack\Reader_Activation::is_enabled() ) : ?>
<!-- wp:newspack/my-account-button {"lock":{"move":false,"remove":true},"className":"is-style-icon-only has-x-small-size","style":{"spacing":{"padding":{"top":"0.375rem","bottom":"0.375rem","left":"0.375rem","right":"0.375rem"}},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}}},"backgroundColor":"base","textColor":"contrast","fontSize":"x-small"} /-->
Expand Down
7 changes: 6 additions & 1 deletion patterns/header/header-mobile-style-4.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@

<!-- wp:group {"style":{"layout":{"columnSpan":2}},"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group">
<!-- wp:template-part {"slug":"mobile-menu","theme":"newspack-block-theme","tagName":"div","lock":{"move":false,"remove":true},"className":"mobile-menu"} /-->
<!-- wp:newspack/overlay-menu {"instanceId":"1a382fccbd5d"} -->
<div class="wp-block-newspack-overlay-menu"><!-- wp:newspack/overlay-menu-trigger {"className":"is-style-icon-only","style":{"color":{"background":"#ffffff00"},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}},"spacing":{"padding":{"right":"0","left":"0"}}},"textColor":"contrast"} /-->
<!-- wp:newspack/overlay-menu-panel -->
<div class="wp-block-newspack-overlay-menu-panel"><!-- wp:navigation {"className":"is-style-flatten","layout":{"type":"flex","setCascadingProperties":true,"orientation":"vertical"}} /--></div>
<!-- /wp:newspack/overlay-menu-panel --></div>
<!-- /wp:newspack/overlay-menu -->
</div>
<!-- /wp:group -->

Expand Down
7 changes: 6 additions & 1 deletion patterns/header/header-mobile-style-5.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
<!-- wp:newspack/my-account-button {"lock":{"move":false,"remove":true},"className":"is-style-icon-only has-x-small-size","style":{"spacing":{"padding":{"top":"0.375rem","bottom":"0.375rem","left":"0.375rem","right":"0.375rem"}},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}}},"backgroundColor":"base","textColor":"contrast","fontSize":"x-small"} /-->
<?php endif; ?>

<!-- wp:template-part {"slug":"mobile-menu","theme":"newspack-block-theme","tagName":"div","lock":{"move":false,"remove":true},"className":"mobile-menu overlay-contents--position--right--force"} /-->
<!-- wp:newspack/overlay-menu {"instanceId":"1a382fccbd5d"} -->
<div class="wp-block-newspack-overlay-menu"><!-- wp:newspack/overlay-menu-trigger {"className":"is-style-icon-only","style":{"color":{"background":"#ffffff00"},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}},"spacing":{"padding":{"right":"0","left":"0"}}},"textColor":"contrast"} /-->
<!-- wp:newspack/overlay-menu-panel {"slideDirection":"right"} -->
<div class="wp-block-newspack-overlay-menu-panel"><!-- wp:navigation {"className":"is-style-flatten","layout":{"type":"flex","setCascadingProperties":true,"orientation":"vertical"}} /--></div>
<!-- /wp:newspack/overlay-menu-panel --></div>
<!-- /wp:newspack/overlay-menu -->
</div>
<!-- /wp:group -->

Expand Down
7 changes: 6 additions & 1 deletion patterns/header/header-mobile-style-6.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@

<!-- wp:template-part {"slug":"search-menu","theme":"newspack-block-theme","tagName":"div","className":"search-menu"} /-->

<!-- wp:template-part {"slug":"mobile-menu","theme":"newspack-block-theme","tagName":"div","lock":{"move":false,"remove":true},"className":"mobile-menu overlay-contents--position--right--force"} /-->
<!-- wp:newspack/overlay-menu {"instanceId":"1a382fccbd5d"} -->
<div class="wp-block-newspack-overlay-menu"><!-- wp:newspack/overlay-menu-trigger {"className":"is-style-icon-only","style":{"color":{"background":"#ffffff00"},"elements":{"link":{"color":{"text":"var:preset|color|contrast"}}},"spacing":{"padding":{"right":"0","left":"0"}}},"textColor":"contrast"} /-->
<!-- wp:newspack/overlay-menu-panel {"slideDirection":"right"} -->
<div class="wp-block-newspack-overlay-menu-panel"><!-- wp:navigation {"className":"is-style-flatten","layout":{"type":"flex","setCascadingProperties":true,"orientation":"vertical"}} /--></div>
<!-- /wp:newspack/overlay-menu-panel --></div>
<!-- /wp:newspack/overlay-menu -->
</div>
<!-- /wp:group -->

Expand Down
2 changes: 0 additions & 2 deletions src/js/front-end/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
import './menus/comments';
import './menus/drawer';
import './menus/mobile';
import './menus/search';
14 changes: 0 additions & 14 deletions src/js/front-end/menus/drawer.js

This file was deleted.

14 changes: 0 additions & 14 deletions src/js/front-end/menus/mobile.js

This file was deleted.

26 changes: 0 additions & 26 deletions src/scss/overlays/_drawer.scss

This file was deleted.

1 change: 0 additions & 1 deletion src/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
@use "header.scss";
@use "overlays/base.scss" as overlays;
@use "overlays/comments.scss";
@use "overlays/drawer.scss";
@use "overlays/search.scss";
Loading