Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a block based theme option #238

Open
wants to merge 21 commits into
base: trunk
Choose a base branch
from
Open

Conversation

fabiankaegy
Copy link
Member

@fabiankaegy fabiankaegy commented Sep 30, 2024

Description of the Change

Adds a new Block Theme scaffold to the repository

Changelog Entry

Added - A new Block-Based Theme Scaffold

Credits

Props @fabiankaegy @tobeycodes @darylldoyle @colinswinney

@fabiankaegy fabiankaegy added enhancement New feature or request Internal Review labels Sep 30, 2024
@fabiankaegy fabiankaegy self-assigned this Sep 30, 2024
@fabiankaegy
Copy link
Member Author

CC: @10up/editorial-engineering Would love to get your all's input on this :)

Also CC: @darylldoyle we can use this new scaffold to update how we are doing things. So if we want to introduce larger coding style / structural changes this is a time where we can include stuff like that :)

"defaultDuotone": false,
"defaultGradients": false,
"defaultPalette": false,
"palette": [
Copy link
Member Author

Choose a reason for hiding this comment

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

Pretty much all the tokens in here are inspired by UI Kit. I don't think we should be as opinionated in the scaffold.

Though I would like us to ship stuff like the section styles for color theming.

Comment on lines 162 to 163
function scrollbar_detection() {
echo '<script>window.addEventListener("DOMContentLoaded",()=>{const t=()=>window.innerWidth-document.body.clientWidth;const e=()=>{document.documentElement.style.setProperty("--wp--custom--scrollbar-width",`${t()}px`)};e();window.addEventListener("resize",e);});</script>' . "\n";
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure we want this in the scaffold.

Copy link
Contributor

Choose a reason for hiding this comment

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

@joesnellpdx
Copy link
Contributor

@fabiankaegy

I'll also share with the FEE Best Practices WG - as some of the suggested and similar changes here have been discussed in that WG

themes/10up-block-theme/includes/core.php Outdated Show resolved Hide resolved
themes/10up-block-theme/functions.php Show resolved Hide resolved
themes/10up-block-theme/phpcs.xml Outdated Show resolved Hide resolved
Copy link
Member

@tobeycodes tobeycodes left a comment

Choose a reason for hiding this comment

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

@fabiankaegy I saw this PR in my notifications and thought I'd leave some comments. Feel free to disregard anything that is not relevant. It looks great! Excited for block themes

themes/10up-block-theme/.lintstagedrc.json Outdated Show resolved Hide resolved
"10up-toolkit lint-js"
],
"*.php": [
"./vendor/bin/phpcs --extensions=php --warning-severity=8 -s"
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: these arguments should in the config itself to prevent inconsistencies with IDE integration and lintstagedrc

    <fileextensions>
        <extension>php</extension>
    </fileextensions>

    <!-- Set the severity level for warnings -->
    <arg name="warning-severity" value="8"/>

    <!-- Show sniff codes in output (-s option) -->
    <arg name="s"/>

Copy link
Member

Choose a reason for hiding this comment

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

thought: we should add this to the .editorconfig file and make sure it's formatted like the other rc files.

https://github.com/10up/wp-scaffold/blob/trunk/.editorconfig#L10

Copy link
Member

Choose a reason for hiding this comment

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

question: can we bump this to the latest LTS?

themes/10up-block-theme/functions.php Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

question: should we be using a cache for performance (e.g. https://github.com/roots/bedrock-autoloader/blob/master/src/Autoloader.php) and perhaps RecursiveDirectoryIterator instead of glob?

themes/10up-block-theme/includes/blocks.php Outdated Show resolved Hide resolved
themes/10up-block-theme/includes/blocks.php Outdated Show resolved Hide resolved
themes/10up-block-theme/includes/core.php Outdated Show resolved Hide resolved
@fabiankaegy fabiankaegy marked this pull request as ready for review January 2, 2025 09:57
@fabiankaegy
Copy link
Member Author

This should be ready for another set of reviews :)

Would love to get it merged soon in the new year 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Internal Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants