Theme 2024: Initial commit of new theme

This commit is contained in:
Kelly Dwan 2024-08-27 10:58:23 -04:00
parent 50c21b4e85
commit 512d7ba421
No known key found for this signature in database
GPG key ID: 8BA5575F3D11575D
17 changed files with 318 additions and 4 deletions

View file

@ -0,0 +1,32 @@
<?php
namespace WordPressDotOrg\Theme\FiveForTheFuture_2024;
require_once __DIR__ . '/inc/block-config.php';
/**
* Actions and filters.
*/
add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\enqueue_assets' );
/**
* Enqueue scripts and styles.
*/
function enqueue_assets() {
$asset_file = get_theme_file_path( 'build/style/index.asset.php' );
if ( ! file_exists( $asset_file ) ) {
return;
}
// The parent style is registered as `wporg-parent-2021-style`, and will be loaded unless
// explicitly unregistered. We can load any child-theme overrides by declaring the parent
// stylesheet as a dependency.
$metadata = require $asset_file;
wp_enqueue_style(
'wporg-5ftf-2024',
get_theme_file_uri( 'build/style/style-index.css' ),
array( 'wporg-parent-2021-style', 'wporg-global-fonts' ),
$metadata['version']
);
}

View file

@ -0,0 +1,47 @@
<?php
/**
* Set up configuration for dynamic blocks.
*/
namespace WordPressDotOrg\Theme\FiveForTheFuture_2024\Block_Config;
add_filter( 'wporg_block_navigation_menus', __NAMESPACE__ . '\add_site_navigation_menus' );
/**
* Provide a list of local navigation menus.
*/
function add_site_navigation_menus( $menus ) {
global $wp_query;
$menu = array();
$menu[] = array(
'label' => __( 'For individuals', 'wporg-5ftf' ),
'url' => '/for-individuals/',
);
$menu[] = array(
'label' => __( 'For organizations', 'wporg-5ftf' ),
'url' => '/for-organizations/',
);
$menu[] = array(
'label' => __( 'Handbook', 'wporg-5ftf' ),
'url' => '/handbook/',
);
$menu[] = array(
'label' => __( 'Pledges', 'wporg-5ftf' ),
'url' => '/pledges/',
);
$menu[] = array(
'label' => __( 'Contact', 'wporg-5ftf' ),
'url' => '/contact/',
);
$menu[] = array(
'label' => __( 'My pledges', 'wporg-5ftf' ),
'url' => '/my-pledges/',
'className' => 'has-separator',
);
return array(
'main' => $menu,
);
}

View file

@ -0,0 +1,28 @@
{
"name": "wporg-5ftf-2024",
"version": "1.0.0",
"description": "",
"author": "WordPress.org",
"license": "GPL-2.0-or-later",
"private": true,
"devDependencies": {
"@wordpress/scripts": "28.6.0"
},
"eslintConfig": {
"extends": "../../.eslintrc.js"
},
"stylelint": {
"extends": "../../.stylelintrc",
"ignoreFiles": [
"**/*.css",
"**/*.css.map"
]
},
"scripts": {
"build": "wp-scripts build --experimental-modules",
"start": "wp-scripts start --experimental-modules",
"lint:js": "wp-scripts lint-js src",
"lint:css": "wp-scripts lint-style src/**/*.scss",
"format": "wp-scripts format src -- --config=../../.prettierrc.js"
}
}

View file

@ -0,0 +1,2 @@
<!-- wp:wporg/global-footer /-->

View file

@ -0,0 +1 @@
<!-- wp:pattern {"slug":"wporg-5ftf-2024/header"} /-->

View file

@ -0,0 +1,39 @@
<?php
/**
* Title: Front Page Header
* Slug: wporg-5ftf-2024/header-front-page
* Inserter: no
*/
?>
<!-- wp:wporg/global-header {"style":{"border":{"bottom":{"color":"var:preset|color|white-opacity-15","style":"solid","width":"1px"}}}} /-->
<!-- wp:wporg/local-navigation-bar {"className":"has-display-contents","backgroundColor":"charcoal-2","style":{"elements":{"link":{"color":{"text":"var:preset|color|white"},":hover":{"color":{"text":"var:preset|color|white"}}}}},"textColor":"white","fontSize":"small"} -->
<!-- wp:site-title {"level":0,"fontSize":"small","className":"wporg-local-navigation-bar__show-on-scroll"} /-->
<!-- wp:navigation {"menuSlug":"main","icon":"menu","overlayBackgroundColor":"charcoal-2","overlayTextColor":"white","layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small"} /-->
<!-- /wp:wporg/local-navigation-bar -->
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"right":"var:preset|spacing|edge-space","left":"var:preset|spacing|edge-space"}}},"backgroundColor":"charcoal-2","className":"has-white-color has-charcoal-2-background-color has-text-color has-background has-link-color","layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull has-white-color has-charcoal-2-background-color has-text-color has-background has-link-color" style="padding-right:var(--wp--preset--spacing--edge-space);padding-left:var(--wp--preset--spacing--edge-space)">
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|40","bottom":"var:preset|spacing|40"},"blockGap":"var:preset|spacing|30"}},"layout":{"type":"flex","flexWrap":"wrap","verticalAlignment":"bottom"}} -->
<div class="wp-block-group alignwide" style="padding-top:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--40)">
<!-- wp:site-title {"level":1,"isLink":false,"style":{"typography":{"fontSize":"50px","lineHeight":"1.2"}}} /-->
<!-- wp:paragraph {"style":{"typography":{"lineHeight":"2.3"}},"textColor":"white"} -->
<p class="has-white-color has-text-color" style="line-height:2.3">WordPress fuels more than a third of the web. Are you a part of it?</p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->
<!-- wp:spacer {"height":"var:preset|spacing|40"} -->
<div style="height:var(--wp--preset--spacing--40)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

View file

@ -0,0 +1,31 @@
<?php
/**
* Title: Header
* Slug: wporg-5ftf-2024/header
* Inserter: no
*/
?>
<!-- wp:wporg/global-header {"style":{"border":{"bottom":{"color":"var:preset|color|white-opacity-15","style":"solid","width":"1px"}}}} /-->
<!-- wp:wporg/local-navigation-bar {"className":"has-display-contents","backgroundColor":"charcoal-2","style":{"elements":{"link":{"color":{"text":"var:preset|color|white"},":hover":{"color":{"text":"var:preset|color|white"}}}}},"textColor":"white","fontSize":"small"} -->
<!-- wp:group {"style":{"spacing":{"blockGap":"0"}},"textColor":"light-grey-1","layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group has-light-grey-1-color has-text-color">
<!-- wp:site-title {"level":0,"fontSize":"small","textColor":"white"} /-->
<!-- wp:post-title {"level":0,"fontSize":"small","fontFamily":"inter","className":"wporg-local-navigation-bar__fade-in-scroll"} /-->
</div>
<!-- /wp:group -->
<!-- wp:navigation {"menuSlug":"main","icon":"menu","overlayBackgroundColor":"charcoal-2","overlayTextColor":"white","layout":{"type":"flex","orientation":"horizontal"},"fontSize":"small"} /-->
<!-- /wp:wporg/local-navigation-bar -->
<!-- wp:wporg/language-suggest {"align":"full"} -->
<div class="wp-block-wporg-language-suggest alignfull"></div>
<!-- /wp:wporg/language-suggest -->
<!-- wp:spacer {"height":"var:preset|spacing|40"} -->
<div style="height:var(--wp--preset--spacing--40)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

View file

@ -0,0 +1,3 @@
{
"script": "file:./index.js"
}

View file

@ -0,0 +1,2 @@
// Noop, just imports the CSS for webpack.
import './style.scss';

View file

@ -0,0 +1,12 @@
/*
* Note: only add styles here in cases where you can't achieve the style with
* templates or theme.json settings.
*/
/* Add default focus style. */
:where(main) a:where(:not(.wp-element-button,.wp-block-wporg-link-wrapper)):focus,
:where(main) button:where(:not([class*="wp-block-button"])):focus {
outline: none;
border-radius: 2px;
box-shadow: 0 0 0 1.5px currentColor;
}

View file

@ -0,0 +1,13 @@
/*
* Theme Name: Five for the Future, 2024
* Theme URI: https://github.com/WordPress/five-for-the-future/
* Author: WordPress.org
* Author URI: https://wordpress.org/
* Description: A block-based child theme for WordPress.org/five/
* Version: 1.0.0
* License: GNU General Public License v2 or later
* Text Domain: wporg-5ftf
* Template: wporg-parent-2021
*/
/* This file is not used. Add CSS to `src/style/*`. */

View file

@ -0,0 +1,15 @@
<!-- wp:pattern {"slug":"wporg-5ftf-2024/header-front-page"} /-->
<!-- wp:group {"tagName":"main","layout":{"type":"constrained"},"className":"entry-content","style":{"spacing":{"blockGap":"0px"}}} -->
<main class="wp-block-group entry-content">
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"right":"var:preset|spacing|edge-space","left":"var:preset|spacing|edge-space"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull" style="padding-right:var(--wp--preset--spacing--edge-space);padding-left:var(--wp--preset--spacing--edge-space)">
<!-- wp:post-content {"layout":{"inherit":true}} /-->
</div>
<!-- /wp:group -->
</main>
<!-- /wp:group -->
<!-- wp:wporg/global-footer /-->

View file

@ -0,0 +1,35 @@
<!-- wp:template-part {"slug":"header","className":"has-display-contents"} /-->
<!-- wp:group {"tagName":"article","layout":{"inherit":true,"type":"constrained"}} -->
<article class="wp-block-group">
<!-- wp:group -->
<div class="wp-block-group">
<!-- wp:post-title {"level":1,"style":{"spacing":{"margin":{"top":"0px"}}}} /-->
</div>
<!-- /wp:group -->
<!-- wp:separator {"align":"full","className":"has-text-color has-light-grey-1-color is-style-wide","style":{"spacing":{"margin":{"top":"var:preset|spacing|40","bottom":"var:preset|spacing|40"}}}} -->
<hr class="wp-block-separator alignfull has-alpha-channel-opacity has-text-color has-light-grey-1-color is-style-wide" style="margin-top:var(--wp--preset--spacing--40);margin-bottom:var(--wp--preset--spacing--40)"/>
<!-- /wp:separator -->
<!-- wp:group {"align":"full","style":{"spacing":{"margin":{"top":"0px"}}}} -->
<div class="wp-block-group alignfull" style="margin-top:0px">
<!-- wp:post-content {"layout":{"inherit":true}} /-->
</div>
<!-- /wp:group -->
</article>
<!-- /wp:group -->
<!-- wp:spacer -->
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- wp:group {"metadata":{"patternName":"wporg-parent-2021/post-navigation","name":"Post Navigation"},"style":{"border":{"top":{"color":"var:preset|color|light-grey-1","width":"1px"}},"spacing":{"padding":{"top":"var:preset|spacing|20","right":"var:preset|spacing|edge-space","bottom":"var:preset|spacing|20","left":"var:preset|spacing|edge-space"}}},"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"space-between"}} -->
<div class="wp-block-group" style="border-top-color:var(--wp--preset--color--light-grey-1);border-top-width:1px;padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--edge-space);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--edge-space)">
<!-- wp:post-navigation-link {"type":"previous","label":"Previous","showTitle":true,"linkLabel":true} /-->
<!-- wp:post-navigation-link {"label":"Next","showTitle":true,"linkLabel":true} /-->
</div>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer"} /-->

View file

@ -0,0 +1,35 @@
<!-- wp:template-part {"slug":"header","className":"has-display-contents"} /-->
<!-- wp:group {"tagName":"article","layout":{"inherit":true,"type":"constrained"}} -->
<article class="wp-block-group">
<!-- wp:group -->
<div class="wp-block-group">
<!-- wp:post-title {"level":1,"style":{"spacing":{"margin":{"top":"0px"}}}} /-->
</div>
<!-- /wp:group -->
<!-- wp:separator {"align":"full","className":"has-text-color has-light-grey-1-color is-style-wide","style":{"spacing":{"margin":{"top":"var:preset|spacing|40","bottom":"var:preset|spacing|40"}}}} -->
<hr class="wp-block-separator alignfull has-alpha-channel-opacity has-text-color has-light-grey-1-color is-style-wide" style="margin-top:var(--wp--preset--spacing--40);margin-bottom:var(--wp--preset--spacing--40)"/>
<!-- /wp:separator -->
<!-- wp:group {"align":"full","style":{"spacing":{"margin":{"top":"0px"}}}} -->
<div class="wp-block-group alignfull" style="margin-top:0px">
<!-- wp:post-content {"layout":{"inherit":true}} /-->
</div>
<!-- /wp:group -->
</article>
<!-- /wp:group -->
<!-- wp:spacer -->
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- wp:group {"metadata":{"patternName":"wporg-parent-2021/post-navigation","name":"Post Navigation"},"style":{"border":{"top":{"color":"var:preset|color|light-grey-1","width":"1px"}},"spacing":{"padding":{"top":"var:preset|spacing|20","right":"var:preset|spacing|edge-space","bottom":"var:preset|spacing|20","left":"var:preset|spacing|edge-space"}}},"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"space-between"}} -->
<div class="wp-block-group" style="border-top-color:var(--wp--preset--color--light-grey-1);border-top-width:1px;padding-top:var(--wp--preset--spacing--20);padding-right:var(--wp--preset--spacing--edge-space);padding-bottom:var(--wp--preset--spacing--20);padding-left:var(--wp--preset--spacing--edge-space)">
<!-- wp:post-navigation-link {"type":"previous","label":"Previous","showTitle":true,"linkLabel":true} /-->
<!-- wp:post-navigation-link {"label":"Next","showTitle":true,"linkLabel":true} /-->
</div>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer"} /-->

View file

@ -0,0 +1,6 @@
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {},
"styles": {}
}