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

Try adding "Stewart", a light blogging theme with a sidebar #4369

Merged
merged 50 commits into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
bcc8407
Try "Stewart" theme
kjellr Aug 5, 2021
cb819c6
Add screenshot, update color scheme.
kjellr Aug 12, 2021
0e27b1d
Add custom font.
kjellr Aug 12, 2021
b8fa980
Round out the templates used.
kjellr Aug 12, 2021
1769c2b
Merge branch 'trunk' into try/add-stewart-theme
kjellr Aug 12, 2021
7d42577
Rearrange stuff.
kjellr Aug 12, 2021
2b9fb32
Change google fonts loading.
kjellr Aug 12, 2021
1260017
Move font family declaration
kjellr Aug 12, 2021
41eb7a1
Correct google fonts loading.
kjellr Aug 12, 2021
dc554be
Revise the tagName for the sidebar.
kjellr Aug 12, 2021
8332494
Tidy up some spacing.
kjellr Aug 12, 2021
4172e91
Ensure each template has a main HTML element in it.
kjellr Aug 12, 2021
e455537
Merge branch 'trunk' into try/add-stewart-theme
kjellr Aug 17, 2021
7c535f5
Merge branch 'trunk' into try/add-stewart-theme
kjellr Dec 6, 2021
cba6b78
Remove blockbase dependency.
kjellr Dec 6, 2021
c72e12a
Get stylesheet working.
kjellr Dec 6, 2021
3f7a4f7
Fix menu.
kjellr Dec 6, 2021
b1d5dd0
Add missing styles.
kjellr Dec 6, 2021
93a6171
Remove custom variables
kjellr Dec 6, 2021
b94cf59
Add archive template, fix footer spacing.
kjellr Dec 6, 2021
110fd86
Add spacing.
kjellr Dec 6, 2021
1d93ca3
Rename folders.
kjellr Dec 6, 2021
7365e90
Remove extra CSS, fix up nav block.
kjellr Dec 6, 2021
9e1ffc1
Add fonts implementation.
kjellr Dec 6, 2021
d50beee
Standardize spacing across templates.
kjellr Dec 6, 2021
e5eec4a
Fix navigation hover styles.
kjellr Dec 6, 2021
91cde59
Adjust spacing.
kjellr Dec 6, 2021
5753435
Fix tagline spacing.
kjellr Dec 6, 2021
74e8506
Fix color variable for social links.
kjellr Dec 6, 2021
d92e28e
Fix up hovers, color presets.
kjellr Dec 6, 2021
55f34d6
Tidy up comment form and buttons
kjellr Dec 6, 2021
fcb0bd2
Fix comments
kjellr Dec 6, 2021
5552665
Readjust tagline spacing
kjellr Dec 6, 2021
0dc9865
Increase logo size, readjust tagline.
kjellr Dec 6, 2021
28cf2e3
Tidy up templates, add button hover style.
kjellr Dec 8, 2021
75f49de
Tidy up theme.json
kjellr Dec 8, 2021
c54c2a7
Tidy up sidebar spacing
kjellr Dec 8, 2021
4808a04
Cleanup readme
kjellr Dec 8, 2021
78cd676
Fix padding around site tagline.
kjellr Dec 8, 2021
35df5c3
Revise colors.
kjellr Dec 9, 2021
03824d3
Make underlines match screenshot.
kjellr Dec 9, 2021
382e228
Fix 50/50 columns enforcement on small screens.
kjellr Dec 9, 2021
960902f
Update mobile spacer size.
kjellr Dec 9, 2021
9ef0b0d
Remove unnecessary flex-grow property.
kjellr Dec 9, 2021
3fa0b28
Revert the columns CSS for now.
kjellr Dec 9, 2021
880f67d
Remove unnecessary classnames.
kjellr Dec 14, 2021
cc93088
Remove unnecessary styles, change hover to opacity instead of a color.
kjellr Dec 14, 2021
e464329
Reinstate the hover colors.
kjellr Dec 14, 2021
d6e645c
Update description.
kjellr Dec 15, 2021
cae0f5f
Update description.
kjellr Dec 15, 2021
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
71 changes: 71 additions & 0 deletions stewart/functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?php

/**
* Sets up theme defaults and registers support for various WordPress features.
*/
function stewart_support() {

// Add support for block styles.
add_theme_support( 'wp-block-styles' );

// Enqueue editor styles.
add_editor_style(
array(
stewart_fonts_url(),
'style.css',
)
);
}
add_action( 'after_setup_theme', 'stewart_support' );


/**
* Enqueue styles.
*/
function stewart_styles() {

// Register theme stylesheet.
wp_register_style(
'stewart-style',
get_stylesheet_directory_uri() . '/style.css',
array(),
wp_get_theme()->get( 'Version' )
);

// Enqueue theme stylesheet.
wp_enqueue_style( 'stewart-style' );

// Enqueue Google fonts
wp_enqueue_style( 'seedlet-fonts', stewart_fonts_url(), array(), null );
}
add_action( 'wp_enqueue_scripts', 'stewart_styles' );


/**
* Add Google webfonts, if necessary
*
* - See: http://themeshaper.com/2014/08/13/how-to-add-google-fonts-to-wordpress-themes/
*/
function stewart_fonts_url() {

$fonts_url = '';

/* Translators: If there are characters in your language that are not
* supported by Work Sans, translate this to 'off'. Do not translate
* into your own language.
*/
$work_sans = esc_html_x( 'on', 'Work Sans: on or off', 'stewart' );

if ( 'off' !== $work_sans ) {
$font_families = 'Work+Sans:ital,wght@0,400;0,700;1,400;1,700';

$query_args = array(
'family' => $font_families,
Copy link
Contributor Author

@kjellr kjellr Dec 6, 2021

Choose a reason for hiding this comment

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

Usually this $font_families variable gets wrapped in urlencode(), but for some reason that wasn't working for me? Could use a second look.

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't appear to urlencode the value in blockbase. This seems right to me.

'subset' => 'latin,latin-ext',
);

$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
}

return esc_url_raw( $fonts_url );
}
5 changes: 5 additions & 0 deletions stewart/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php
// There is nothing output here because block themes do not use php templates.
// There is a core ticket discussing removing this requirement for block themes:
// https://core.trac.wordpress.org/ticket/54272.

15 changes: 15 additions & 0 deletions stewart/parts/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- wp:spacer {"height":60} -->
<div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:group -->
<div class="wp-block-group">
<!-- wp:paragraph {"align":"center","fontSize":"tiny"} -->
<p class="has-text-align-center has-tiny-font-size">Proudly Powered by <a href="https://wordpress.org" rel="nofollow">WordPress</a></p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:group -->

<!-- wp:spacer {"height":60} -->
<div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
3 changes: 3 additions & 0 deletions stewart/parts/header-spacer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:spacer {"height":70} -->
<div style="height:70px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
6 changes: 6 additions & 0 deletions stewart/parts/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- wp:group {"align":"full","layout":{"type":"flex","justifyContent":"space-between"},"style":{"spacing":{"padding":{"top":"var(--wp--custom--margin--horizontal, 30px)","bottom":"40px"}}}} -->
<div class="wp-block-group alignfull" style="padding-top:var(--wp--custom--margin--horizontal, 30px);padding-bottom:40px">
<!-- wp:site-title /-->
<!-- wp:navigation {"isResponsive":true,"__unstableLocation":"primary"} /-->
</div>
<!-- /wp:group -->
35 changes: 35 additions & 0 deletions stewart/parts/sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!-- wp:group -->
<div class="wp-block-group"><!-- wp:site-logo {"width":90,"className":"is-style-rounded"} /-->

<!-- wp:site-title {"fontSize":"gigantic","style":{"typography":{"lineHeight":"1.2"}}} /-->

<!-- wp:site-tagline {"fontSize":"small"} /-->

<!-- wp:separator {"className":"is-style-wide"} -->
<hr class="wp-block-separator is-style-wide"/>
<!-- /wp:separator -->

<!-- wp:spacer {"height":1} -->
<div style="height:1px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:navigation {"layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"left","orientation":"vertical"},"style":{"spacing":{"blockGap":"0px"}}} -->
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
<!-- /wp:navigation -->

<!-- wp:separator {"className":"is-style-wide"} -->
<hr class="wp-block-separator is-style-wide"/>
<!-- /wp:separator -->

<!-- wp:social-links {"iconColor":"foreground","iconColorValue":"var(--wp--preset--color--foreground)","className":"items-justified-left is-style-logos-only"} -->
<ul class="wp-block-social-links has-icon-color items-justified-left is-style-logos-only"><!-- wp:social-link {"url":"#","service":"twitter"} /-->

<!-- wp:social-link {"url":"#","service":"facebook"} /-->

<!-- wp:social-link {"url":"#","service":"instagram"} /--></ul>
<!-- /wp:social-links --></div>
<!-- /wp:group -->

<!-- wp:spacer {"height":80} -->
<div style="height:80px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
37 changes: 37 additions & 0 deletions stewart/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
=== Stewart ===
Contributors: automattic
Requires at least: 5.8
Tested up to: 5.9
Requires PHP: 5.6
Stable tag: 1.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

== Description ==

A simple theme for blogging.

== Changelog ==

= 1.0 =
* Released: December

== Copyright ==

Stewart WordPress Theme, (C) 2021 Automattic, Inc.
Stewart is distributed under the terms of the GNU GPL.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

This theme uses the following third-party resource in its theme screenshot:

"Swedish Windows / Fönster no. 1" by Fons Heijnsbroek
https://www.flickr.com/photos/abstract-art-fons/28822761186/
Binary file added stewart/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
119 changes: 119 additions & 0 deletions stewart/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/*
Theme Name: Stewart
Theme URI: https://github.com/Automattic/themes/tree/trunk/stewart
Author: Automattic
Author URI: https://automattic.com/
Description: A simple theme for blogging.
Requires at least: 5.7
Tested up to: 5.9
Requires PHP: 5.7
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: stewart
Tags: block-styles, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, rtl-language-support, theme-options, threaded-comments, translation-ready, wide-blocks

Stewart WordPress Theme, (C) 2021 Automattic, Inc.
Stewart is distributed under the terms of the GNU GPL.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

This theme uses the following third-party resource in its theme screenshot:

"Swedish Windows / Fönster no. 1" by Fons Heijnsbroek
https://www.flickr.com/photos/abstract-art-fons/28822761186/

*/

/*
* Font smoothing.
* This is a niche setting that will not be available via Global Styles.
* https://github.com/WordPress/gutenberg/issues/35934
*/

body {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
}

/*
* Link Details
*/

a {
text-decoration-thickness: 0.075ex;
text-underline-offset: 0.125em;
}

.wp-block-site-title a {
text-decoration: none;
}

a:hover,
.wp-block-site-title a:hover,
.wp-block-post-title a:hover,
.wp-block-post-date a:hover {
color: var(--wp--preset--color--primary);
}

.wp-block-navigation .wp-block-navigation-link a,
.wp-block-navigation .wp-block-page-list a,
.wp-block-navigation .wp-block-pages-list__item a,
.wp-block-navigation .wp-block-post-title a {
text-decoration: underline;
}

.wp-block-navigation .wp-block-navigation-link a:hover,
.wp-block-navigation .wp-block-page-list a:hover,
.wp-block-navigation .wp-block-pages-list__item a:hover,
.wp-block-navigation .wp-block-post-title a:hover {
color: var(--wp--preset--color--primary);
text-decoration: none;
}

/*
* Button hover styles.
* Necessary until the following issue is resolved in Gutenberg:
* https://github.com/WordPress/gutenberg/issues/27075
*/

.wp-block-search__button:hover,
.wp-block-file .wp-block-file__button:hover,
.wp-block-button__link:hover {
opacity: 0.90;
}

/*
* Search and File Block button styles.
* Necessary until the following issues are resolved in Gutenberg:
* https://github.com/WordPress/gutenberg/issues/36444
* https://github.com/WordPress/gutenberg/issues/27760
*/

.wp-block-search__button,
.wp-block-file .wp-block-file__button {
background-color: var(--wp--preset--color--primary);
border-radius: 0;
border: none;
color: var(--wp--preset--color--background);
font-size: var(--wp--preset--typography--font-size--normal);
padding: calc(.667em + 2px) calc(1.333em + 2px);
}

/*
* Comment Form Fields
*/

.wp-block-post-comments input:not([type=submit]),
.wp-block-post-comments textarea {
background-color: var(--wp--preset--color--background);
border-color: var(--wp--preset--color--foreground);
}
45 changes: 45 additions & 0 deletions stewart/templates/archive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!-- wp:template-part {"slug":"header-spacer","tagName":"header"} /-->

<!-- wp:group {"align":"wide","layout":{"inherit":true}} -->
<div class="wp-block-group alignwide"><!-- wp:columns {"align":"wide"} -->
<div class="wp-block-columns alignwide"><!-- wp:column {"width":"30%"} -->
<div class="wp-block-column" style="flex-basis:30%"><!-- wp:template-part {"slug":"sidebar","tagName":"aside"} /--></div>
<!-- /wp:column -->

<!-- wp:column {"width":"70%","style":{"spacing":{"padding":{"top":"0px","right":"0px","bottom":"0px","left":"0px"}}}} -->
<div class="wp-block-column" style="padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;flex-basis:70%"><!-- wp:group {"tagName":"main"} -->
<main class="wp-block-group"><!-- wp:query-title {"type":"archive","fontSize":"huge"} /-->

<!-- wp:spacer {"height":30} -->
<div style="height:30px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:query {"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"displayLayout":{"type":"list","columns":2}} -->
<div class="wp-block-query"><!-- wp:post-template -->
<!-- wp:post-title {"isLink":true,"fontSize":"huge","style":{"typography":{"lineHeight":"1.2"}}} /-->

<!-- wp:post-featured-image {"isLink":true} /-->

<!-- wp:post-excerpt {"fontSize":"normal"} /-->

<!-- wp:post-date {"isLink":true,"fontSize":"extra-small"} /-->

<!-- wp:spacer {"height":60} -->
<div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- /wp:post-template -->

<!-- wp:query-pagination -->
<div class="wp-block-query-pagination"><!-- wp:query-pagination-previous /-->

<!-- wp:query-pagination-numbers /-->

<!-- wp:query-pagination-next /--></div>
<!-- /wp:query-pagination --></div>
<!-- /wp:query --></main>
<!-- /wp:group --></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","layout":{"inherit":true}} /-->
1 change: 1 addition & 0 deletions stewart/templates/blank.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:post-content {"layout":{"inherit":true}} /-->
10 changes: 10 additions & 0 deletions stewart/templates/header-footer-only.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

<!-- wp:group {"tagName":"main"} -->
<main class="wp-block-group">

<!-- wp:post-content {"layout":{"inherit":true}} /-->
</main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","layout":{"inherit":true}} /-->
Loading