Skip to content

Commit

Permalink
Sten: Add theme for review (#7015)
Browse files Browse the repository at this point in the history
* Add Sten theme for review

* removing not needed styles

* updating version

* removing unused key

* removing new lines from css in theme.json

* removing unused patterns

* Revert "removing new lines from css in theme.json"

This reverts commit 32fc8ab.

* removing new line characters from CSS in theme.json
  • Loading branch information
matiasbenedetto authored Jun 27, 2023
1 parent 8d541ee commit 5b5e1af
Show file tree
Hide file tree
Showing 14 changed files with 892 additions and 0 deletions.
60 changes: 60 additions & 0 deletions sten/functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
/**
* Sten functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Sten
* @since Sten 1.0
*/


if ( ! function_exists( 'sten_support' ) ) :

/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @since Sten 1.0
*
* @return void
*/
function sten_support() {

// Enqueue editor styles.
add_editor_style( 'style.css' );

// Make theme available for translation.
load_theme_textdomain( 'sten' );
}

endif;

add_action( 'after_setup_theme', 'sten_support' );

if ( ! function_exists( 'sten_styles' ) ) :

/**
* Enqueue styles.
*
* @since Sten 1.0
*
* @return void
*/
function sten_styles() {

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

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

}

endif;

add_action( 'wp_enqueue_scripts', 'sten_styles' );
13 changes: 13 additions & 0 deletions sten/parts/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- wp:spacer {"height":"var(\u002d\u002dwp\u002d\u002dpreset\u002d\u002dspacing\u002d\u002d80)"} -->
<div style="height:var(--wp--preset--spacing--80)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:group {"style":{"spacing":{"padding":{"bottom":"var:preset|spacing|80"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group" style="padding-bottom:var(--wp--preset--spacing--80)"><!-- wp:group {"align":"wide","style":{"spacing":{"blockGap":"var:preset|spacing|60"}},"layout":{"type":"default"}} -->
<div class="wp-block-group alignwide"><!-- wp:search {"showLabel":false,"placeholder":"Search...","width":75,"widthUnit":"%","buttonUseIcon":true,"style":{"layout":{"selfStretch":"fit"},"border":{"width":"0px","style":"none","radius":"4px"}},"anchor":""} /-->

<!-- wp:paragraph {"align":"left","style":{"typography":{"fontSize":"0.8rem"}}} -->
<p class="has-text-align-left" style="font-size:0.8rem">Designed with <a rel="nofollow" href="https://wordpress.org">WordPress</a></p>
<!-- /wp:paragraph --></div>
<!-- /wp:group --></div>
<!-- /wp:group -->
19 changes: 19 additions & 0 deletions sten/parts/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- wp:group {"style":{"spacing":{"padding":{"top":"var:preset|spacing|50"}}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group" style="padding-top:var(--wp--preset--spacing--50)"><!-- wp:group {"align":"wide","style":{"spacing":{"blockGap":"var:preset|spacing|20"}},"layout":{"type":"default"}} -->
<div class="wp-block-group alignwide"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"0","top":"0","right":"0","left":"0"}}},"layout":{"type":"flex","justifyContent":"space-between","verticalAlignment":"center"}} -->
<div class="wp-block-group alignwide" style="padding-top:0;padding-right:0;padding-bottom:0;padding-left:0"><!-- wp:group {"style":{"spacing":{"blockGap":"var:preset|spacing|30"}},"layout":{"type":"flex","orientation":"vertical"}} -->
<div class="wp-block-group"><!-- wp:site-title /--></div>
<!-- /wp:group -->

<!-- wp:navigation {"ref":6,"overlayBackgroundColor":"background","overlayTextColor":"primary","layout":{"type":"flex","justifyContent":"right"}} /--></div>
<!-- /wp:group -->

<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"0","top":"0","right":"0","left":"0"}}},"layout":{"type":"flex","justifyContent":"space-between","verticalAlignment":"center"}} -->
<div class="wp-block-group alignwide" style="padding-top:0;padding-right:0;padding-bottom:0;padding-left:0"><!-- wp:site-tagline /--></div>
<!-- /wp:group --></div>
<!-- /wp:group --></div>
<!-- /wp:group -->

<!-- wp:spacer {"height":"var(\u002d\u002dwp\u002d\u002dpreset\u002d\u002dspacing\u002d\u002d80)"} -->
<div style="height:var(--wp--preset--spacing--80)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
5 changes: 5 additions & 0 deletions sten/parts/post-meta.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:group {"align":"full","layout":{"type":"flex"}} -->
<div class="wp-block-group alignfull"><!-- wp:post-date {"format":"j.n.Y","isLink":true,"fontSize":"small"} /--></div>
<!-- /wp:group --></div>
<!-- /wp:group -->
23 changes: 23 additions & 0 deletions sten/parts/sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- wp:paragraph {"style":{"typography":{"fontSize":"1.4rem"},"spacing":{"padding":{"bottom":"var:preset|spacing|50"}}}} -->
<p style="padding-bottom:var(--wp--preset--spacing--50);font-size:1.4rem">More Posts</p>
<!-- /wp:paragraph -->

<!-- wp:query {"queryId":9,"query":{"perPage":6,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false},"layout":{"type":"default"}} -->
<div class="wp-block-query"><!-- wp:post-template -->
<!-- wp:columns {"verticalAlignment":"center","isStackedOnMobile":false,"style":{"border":{"top":{"width":"0px","style":"none"},"right":{"width":"0px","style":"none"},"bottom":{"width":"2px","color":"var:preset|color|primary"},"left":{"width":"0px","style":"none"}},"spacing":{"padding":{"bottom":"var:preset|spacing|30"}}}} -->
<div class="wp-block-columns are-vertically-aligned-center is-not-stacked-on-mobile" style="border-top-style:none;border-top-width:0px;border-right-style:none;border-right-width:0px;border-bottom-color:var(--wp--preset--color--primary);border-bottom-width:2px;border-left-style:none;border-left-width:0px;padding-bottom:var(--wp--preset--spacing--30)"><!-- wp:column {"verticalAlignment":"center","width":"20%"} -->
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:20%"><!-- wp:post-date {"format":"d.m","style":{"typography":{"fontSize":"1rem"}}} /--></div>
<!-- /wp:column -->

<!-- wp:column {"verticalAlignment":"center","width":"90%"} -->
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:90%"><!-- wp:post-title {"isLink":true,"style":{"typography":{"fontSize":"1rem"}}} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->
<!-- /wp:post-template -->

<!-- wp:query-no-results -->
<!-- wp:paragraph {"placeholder":"Add text or blocks that will display when a query returns no results."} -->
<p>There are no posts.</p>
<!-- /wp:paragraph -->
<!-- /wp:query-no-results --></div>
<!-- /wp:query -->
32 changes: 32 additions & 0 deletions sten/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
=== Sten ===
Contributors: Automattic
Requires at least: 5.8
Tested up to: 5.9
Requires PHP: 5.7
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

== Description ==

Sten is a simple blogging theme with a functional design. It is ideal for taking notes, writing short or long text, and includes a post sidebar and comment section.

== Changelog ==

= 0.0.1 =
* Initial release

== Copyright ==

Sten WordPress Theme, (C) 2023 Automattic
Sten is distributed under the terms of the GNU GPL.
Sten is based on Block Canvas (https://github.com/Automattic/themes/tree/trunk/block-canvas), (C) Automattic, [GPLv2 or later](http://www.gnu.org/licenses/gpl-2.0.html)

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.
Binary file added sten/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions sten/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
Theme Name: Sten
Theme URI:
Author: Automattic
Author URI: https://automattic.com
Description: Sten is a simple blogging theme with a functional design. It is ideal for taking notes, writing short or long text, and includes a post sidebar and comment section.
Requires at least: 5.8
Tested up to: 5.9
Requires PHP: 5.7
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sten
Tags: blog, news, one-column, right-sidebar, wide-blocks, block-patterns, custom-colors, custom-logo, custom-menu, editor-style, full-site-editing, rtl-language-support, theme-options, threaded-comments, translation-ready, notes, sidebar
/*
* Control the hover stylings of outline block style.
* Unnecessary once block styles are configurable via theme.json
* https://github.com/WordPress/gutenberg/issues/42794
*/
.wp-block-button.is-style-outline>.wp-block-button__link:not(.has-background):hover {
background-color: var(--wp--preset--color--secondary);
color: var(--wp--preset--color--background);
border-color: var(--wp--preset--color--secondary);
}

/*
* Link styles
* https://github.com/WordPress/gutenberg/issues/42319
*/
a {
text-decoration-thickness: .0625em !important;
text-underline-offset: .15em;
}
29 changes: 29 additions & 0 deletions sten/templates/archive.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!-- wp:template-part {"slug":"header","theme":"sten","tagName":"header"} /-->

<!-- wp:query {"queryId":0,"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true,"taxQuery":null,"parents":[]},"tagName":"main","layout":{"type":"constrained"}} -->
<main class="wp-block-query"><!-- wp:query-title {"type":"archive","align":"wide","style":{"spacing":{"margin":{"bottom":"100px"}}}} /-->

<!-- wp:post-template {"align":"wide"} -->
<!-- wp:group {"style":{"border":{"top":{"width":"0px","style":"none"},"bottom":{"color":"var:preset|color|primary","width":"2px"}},"spacing":{"padding":{"top":"0","bottom":"0.6rem"}}},"layout":{"type":"default"}} -->
<div class="wp-block-group" style="border-top-style:none;border-top-width:0px;border-bottom-color:var(--wp--preset--color--primary);border-bottom-width:2px;padding-top:0;padding-bottom:0.6rem"><!-- wp:columns {"verticalAlignment":"center","isStackedOnMobile":false,"style":{"spacing":{"padding":{"top":"0"}}}} -->
<div class="wp-block-columns are-vertically-aligned-center is-not-stacked-on-mobile" style="padding-top:0"><!-- wp:column {"verticalAlignment":"center","width":"16%"} -->
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:16%"><!-- wp:post-date {"format":"d.m"} /--></div>
<!-- /wp:column -->

<!-- wp:column {"verticalAlignment":"center","width":"84%"} -->
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:84%"><!-- wp:post-title {"isLink":true} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:group -->
<!-- /wp:post-template -->

<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50"}}},"layout":{"type":"default"}} -->
<div class="wp-block-group alignwide" style="padding-top:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50)"><!-- wp:query-pagination {"align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
<!-- wp:query-pagination-previous /-->

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

<!-- wp:template-part {"slug":"footer","theme":"sten","tagName":"footer"} /-->
27 changes: 27 additions & 0 deletions sten/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!-- wp:template-part {"slug":"header","theme":"sten","tagName":"header"} /-->

<!-- wp:query {"queryId":0,"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true,"taxQuery":null,"parents":[]},"tagName":"main","layout":{"type":"constrained"}} -->
<main class="wp-block-query"><!-- wp:post-template {"align":"wide"} -->
<!-- wp:group {"style":{"border":{"top":{"width":"0px","style":"none"},"bottom":{"color":"var:preset|color|primary","width":"2px"}},"spacing":{"padding":{"top":"0","bottom":"0.6rem"}}},"layout":{"type":"default"}} -->
<div class="wp-block-group" style="border-top-style:none;border-top-width:0px;border-bottom-color:var(--wp--preset--color--primary);border-bottom-width:2px;padding-top:0;padding-bottom:0.6rem"><!-- wp:columns {"verticalAlignment":"center","isStackedOnMobile":false,"style":{"spacing":{"padding":{"top":"0"}}}} -->
<div class="wp-block-columns are-vertically-aligned-center is-not-stacked-on-mobile" style="padding-top:0"><!-- wp:column {"verticalAlignment":"center","width":"16%"} -->
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:16%"><!-- wp:post-date {"format":"d.m"} /--></div>
<!-- /wp:column -->

<!-- wp:column {"verticalAlignment":"center","width":"84%"} -->
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:84%"><!-- wp:post-title {"isLink":true} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:group -->
<!-- /wp:post-template -->

<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50"}}},"layout":{"type":"default"}} -->
<div class="wp-block-group alignwide" style="padding-top:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50)"><!-- wp:query-pagination {"align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
<!-- wp:query-pagination-previous /-->

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

<!-- wp:template-part {"slug":"footer","theme":"sten","tagName":"footer"} /-->
15 changes: 15 additions & 0 deletions sten/templates/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- wp:template-part {"slug":"header","theme":"sten","tagName":"header"} /-->

<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:post-title {"align":"wide","fontSize":"large"} /--></div>
<!-- /wp:group -->

<!-- wp:group {"tagName":"main","lock":{"move":false,"remove":true},"layout":{"type":"constrained"}} -->
<main class="wp-block-group"><!-- wp:post-content {"lock":{"move":false,"remove":false},"align":"wide","layout":{"type":"constrained","justifyContent":"left"}} /-->

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

<!-- wp:template-part {"slug":"footer","theme":"sten","tagName":"footer"} /-->
39 changes: 39 additions & 0 deletions sten/templates/search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!-- wp:template-part {"slug":"header","theme":"sten","tagName":"header"} /-->

<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:query-title {"type":"search","align":"wide"} /-->

<!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
<div class="wp-block-group alignwide"><!-- wp:search {"showLabel":false,"placeholder":"Search...","widthUnit":"%","buttonUseIcon":true,"style":{"layout":{"selfStretch":"fit"},"border":{"width":"0px","style":"none","radius":"4px"}},"anchor":""} /--></div>
<!-- /wp:group -->

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

<!-- wp:query {"queryId":0,"query":{"perPage":10,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":true,"taxQuery":null,"parents":[]},"tagName":"main","layout":{"type":"constrained"}} -->
<main class="wp-block-query"><!-- wp:post-template {"align":"wide"} -->
<!-- wp:group {"style":{"border":{"top":{"width":"0px","style":"none"},"bottom":{"color":"var:preset|color|primary","width":"2px"}},"spacing":{"padding":{"top":"0","bottom":"0.6rem"}}},"layout":{"type":"default"}} -->
<div class="wp-block-group" style="border-top-style:none;border-top-width:0px;border-bottom-color:var(--wp--preset--color--primary);border-bottom-width:2px;padding-top:0;padding-bottom:0.6rem"><!-- wp:columns {"verticalAlignment":"center","isStackedOnMobile":false,"style":{"spacing":{"padding":{"top":"0"}}}} -->
<div class="wp-block-columns are-vertically-aligned-center is-not-stacked-on-mobile" style="padding-top:0"><!-- wp:column {"verticalAlignment":"center","width":"16%"} -->
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:16%"><!-- wp:post-date {"format":"d.m"} /--></div>
<!-- /wp:column -->

<!-- wp:column {"verticalAlignment":"center","width":"84%"} -->
<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:84%"><!-- wp:post-title {"isLink":true} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:group -->
<!-- /wp:post-template -->

<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|50","bottom":"var:preset|spacing|50"}}},"layout":{"type":"default"}} -->
<div class="wp-block-group alignwide" style="padding-top:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--50)"><!-- wp:query-pagination {"align":"wide","layout":{"type":"flex","justifyContent":"space-between"}} -->
<!-- wp:query-pagination-previous /-->

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

<!-- wp:template-part {"slug":"footer","theme":"sten","tagName":"footer"} /-->
Loading

0 comments on commit 5b5e1af

Please sign in to comment.