Skip to content

Commit 1b77240

Browse files
committed
Created starter theme
1 parent 51ac194 commit 1b77240

18 files changed

+414
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# System
2+
.DS_Store
3+
14
# Logs
25
logs
36
*.log

assets/js/main.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
jQuery( document ).ready( ($) => {
2+
console.log('jquery ready');
3+
4+
$('.wp-block-navigation-item a').on('click', function() {
5+
$(this).closest('.is-menu-open').removeClass('is-menu-open');
6+
});
7+
8+
});

assets/scss/_assets.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
$bp-d: 900px;
3+
$bp-de: 37.5rem;
4+
$bp-s: 0;
5+
$bp-m: 0;
6+
$bp-l: 0;
7+
8+
9+
10+
11+
@mixin bp-max ($bp: $bp-d) {
12+
@media screen and (max-width: ($bp - 1px)) {
13+
@content;
14+
}
15+
}
16+
17+
@mixin bp-min ($bp: $bp-d) {
18+
@media screen and (min-width: ($bp)) {
19+
@content;
20+
}
21+
}

assets/scss/_block_style.scss

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
3+
.wp-block-group:where(.has-background) {
4+
padding: 0px;
5+
}
6+
7+
.is-style-padding {
8+
padding-left: var(--wp--custom--page--spacing--outer);
9+
padding-left: var(--wp--custom--page--spacing--outer);
10+
}
11+
12+
.is-style-content-padding {
13+
padding-left: var(--wp--custom--page--spacing--outer);
14+
padding-right: var(--wp--custom--page--spacing--outer);
15+
16+
& .alignfull {
17+
padding-left: var(--wp--custom--page--spacing--outer);
18+
padding-right: var(--wp--custom--page--spacing--outer);
19+
margin-left: calc(-1 * var(--wp--custom--page--spacing--outer)) !important;
20+
margin-right: calc(-1 * var(--wp--custom--page--spacing--outer)) !important;
21+
width: auto !important;
22+
23+
&.wp-block-cover {
24+
}
25+
}
26+
}

functions.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
/**
4+
* Inits
5+
*/
6+
add_action( 'after_setup_theme', 'trebuchet_setup' );
7+
add_action( 'wp_enqueue_scripts', 'trebuchet_styles' );
8+
9+
/**
10+
* Includes
11+
*/
12+
include plugin_dir_path( __FILE__ ) . "inc/register_inc.php";
13+
14+
if ( ! function_exists( 'trebuchet_setup' ) ) :
15+
/**
16+
* Sets up theme defaults and registers support for various WordPress features.
17+
*
18+
* Note that this function is hooked into the after_setup_theme hook, which runs
19+
* before the init hook.
20+
*/
21+
function trebuchet_setup() {
22+
// Add support for block styles.
23+
add_theme_support( 'wp-block-styles' );
24+
25+
// Enqueue editor styles.
26+
add_editor_style( 'style.css' );
27+
}
28+
endif; // trebuchet_setup
29+
30+
31+
if ( ! function_exists( 'trebuchet_styles' ) ) :
32+
function trebuchet_styles() {
33+
wp_register_style(
34+
'trebuchet-style',
35+
get_template_directory_uri() . '/style.css',
36+
array(),
37+
filemtime( get_template_directory() . '/style.css', )
38+
);
39+
40+
wp_enqueue_style('trebuchet-style');
41+
wp_enqueue_script('trebuchet-js', get_template_directory_uri() . '/assets/js/main.js', array('jquery'), filemtime( get_template_directory() . '/assets/js/main.js'));
42+
}
43+
endif;

inc/register_inc.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
foreach ( glob( plugin_dir_path( __FILE__ ) . "styles/*.php" ) as $file ) {
3+
include_once $file;
4+
}
5+
foreach ( glob( plugin_dir_path( __FILE__ ) . "patterns/*.php" ) as $file ) {
6+
include_once $file;
7+
}

inc/styles/core-group.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
register_block_style(
3+
'core/group',
4+
array(
5+
'name' => 'content-padding',
6+
'label' => __( 'Content Spacing', 'trebuchet' ),
7+
'is_default' => false
8+
)
9+
);

inc/styles/core-post-content.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
register_block_style(
3+
'core/post-content',
4+
array(
5+
'name' => 'content-padding',
6+
'label' => __( 'Content Spacing', 'trebuchet' ),
7+
'is_default' => false
8+
)
9+
);

inc/styles/core-query.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
wp_enqueue_block_style('core/query', array(
3+
'src' => ''
4+
));

index.php

Whitespace-only changes.

0 commit comments

Comments
 (0)