-
Notifications
You must be signed in to change notification settings - Fork 50
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
base: trunk
Are you sure you want to change the base?
Conversation
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 :) |
themes/10up-block-theme/theme.json
Outdated
"defaultDuotone": false, | ||
"defaultGradients": false, | ||
"defaultPalette": false, | ||
"palette": [ |
There was a problem hiding this comment.
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.
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"; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this 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
"10up-toolkit lint-js" | ||
], | ||
"*.php": [ | ||
"./vendor/bin/phpcs --extensions=php --warning-severity=8 -s" |
There was a problem hiding this comment.
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"/>
themes/10up-block-theme/.eslintrc
Outdated
There was a problem hiding this comment.
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
themes/10up-block-theme/.nvmrc
Outdated
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
This should be ready for another set of reviews :) Would love to get it merged soon in the new year 🚀 |
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