Skip to content

Commit

Permalink
Issue #1 - create an empty theme using new-empty-theme.php from theme…
Browse files Browse the repository at this point in the history
…-experiments
  • Loading branch information
bobbingwide committed Mar 19, 2021
1 parent e49f899 commit 8622696
Show file tree
Hide file tree
Showing 8 changed files with 187 additions and 0 deletions.
79 changes: 79 additions & 0 deletions assets/alignments-front.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* Alignments, loaded in the front-end only.
*/

body {
margin: 0;
}

* {
box-sizing: border-box;
}

.wp-site-blocks,
.wp-block-template-part.alignfull {
padding: 0 var(--wp--custom--margin--horizontal);
}

.wp-site-blocks > *:not(.wp-block-post-content),
.wp-site-blocks .wp-block-post-content > * {
max-width: var(--wp--custom--width--default);
margin-left: auto;
margin-right: auto;
}

.wp-site-blocks .alignwide {
width: var(--wp--custom--width--wide);
max-width: 100%;
margin-left: auto;
margin-right: auto;
}

.wp-site-blocks .alignfull {
transform: translateX(calc(0px - var(--wp--custom--margin--horizontal)));
width: calc(100% + (2 * var(--wp--custom--margin--horizontal)));
max-width: calc(100% + (2 * var(--wp--custom--margin--horizontal)));
margin-left: 0;
margin-right: 0;
box-sizing: content-box;
}

.wp-site-blocks .wp-block-template-part.alignfull {
width: 100%;
max-width: 100%;
}

.wp-site-blocks .wp-block-columns.alignfull {
width: 100%;
max-width: 100%;
}

.aligncenter {
text-align: center;
}

.wp-site-blocks .alignleft {
float: left;
margin-right: 2em;
max-width: 360px;
}

.wp-site-blocks .alignright {
float: right;
margin-left: 2em;
max-width: 360px;
}

@media screen and (min-width: 1290px) {

.wp-site-blocks,
.wp-block-template-part.alignfull {
padding: 0;
}

.wp-site-blocks .alignfull {
transform: translateX(0px);
width: 100%;
max-width: 100%;
}
}
3 changes: 3 additions & 0 deletions block-template-parts/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:site-title /-->

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

<!-- wp:query {"queryId":1,"query":{"offset":0,"postType":"post","categoryIds":[],"tagIds":[],"order":"desc","orderBy":"date","author":"","search":"","sticky":""}} -->
<!-- wp:query-loop -->
<!-- wp:post-title {"isLink":true} /-->

<!-- wp:post-excerpt /-->
<!-- /wp:query-loop -->
<!-- /wp:query -->
5 changes: 5 additions & 0 deletions block-templates/singular.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- wp:template-part {"slug":"header","theme":"sb","tagName":"header"} /-->

<!-- wp:post-title /-->

<!-- wp:post-content /-->
34 changes: 34 additions & 0 deletions experimental-theme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"settings": {
"defaults": {
"color": {
"gradients": [ ],
"link": true,
"palette": [ ]
},
"spacing": {
"customPadding": true
},
"typography": {
"customLineHeight": true,
"fontFamilies": [ ],
"fontSizes": [ ]
},
"custom": {
"width": {
"default": "840px",
"wide": "1100px"
},
"margin": {
"horizontal": "14px"
}
}
}
},
"styles": {
"root": {
"color": { },
"typography": { }
}
}
}
41 changes: 41 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

if ( ! function_exists( 'sb_support' ) ) :
function sb_support() {

// Adding support for featured images.
add_theme_support( 'post-thumbnails' );

// Adding support for alignwide and alignfull classes in the block editor.
add_theme_support( 'align-wide' );

// Adding support for core block visual styles.
add_theme_support( 'wp-block-styles' );

// Adding support for responsive embedded content.
add_theme_support( 'responsive-embeds' );

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

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

// Add support for custom units.
add_theme_support( 'custom-units' );
}
add_action( 'after_setup_theme', 'sb_support' );
endif;

/**
* Enqueue scripts and styles.
*/
function sb_scripts() {

// Enqueue theme stylesheet.
wp_enqueue_style( 'sb-style', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get( 'Version' ) );

// Enqueue alignments stylesheet.
wp_enqueue_style( 'sb-alignments-style', get_template_directory_uri() . '/assets/alignments-front.css', array(), wp_get_theme()->get( 'Version' ) );
}
add_action( 'wp_enqueue_scripts', 'sb_scripts' );
Empty file added index.php
Empty file.
16 changes: 16 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
Theme Name: SB
Theme URI: https://seriouslybonkers.com
Author: Herb Miller
Description: Seriously Bonker's experimental Full Site Editing theme
Requires at least: 5.3
Tested up to: 5.5
Requires PHP: 5.6
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sb
SB WordPress Theme, (C) 2021 WordPress.org
SB is distributed under the terms of the GNU GPL.
*/

0 comments on commit 8622696

Please sign in to comment.