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

Register editor style.css, add theme.json and create block patterns #757

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0e93288
Register editor-style.css
crftwrk Apr 28, 2024
23b7655
Register block pattern category
crftwrk Apr 28, 2024
048cade
Create col-6-col-6.php
crftwrk Apr 28, 2024
2f5e058
Update col-6-col-6.php
crftwrk Apr 28, 2024
55f67c3
Create col-4-col-8.php
crftwrk Apr 28, 2024
c7c25e6
Update col-4-col-8.php
crftwrk Apr 28, 2024
9302ca7
Create col-8-col-4.php
crftwrk Apr 28, 2024
370b5b6
Create button patterns
crftwrk Apr 28, 2024
d98a35c
Create theme.json
crftwrk Apr 28, 2024
94b8902
Update _block-widgets.scss
crftwrk Apr 28, 2024
185202d
Update _block-widgets.scss
crftwrk Apr 28, 2024
d2d066f
Fix column patterns
crftwrk Apr 28, 2024
6e54c2c
Added a card pattern
crftwrk Apr 28, 2024
e82b6fe
Added alert patterns
crftwrk Apr 28, 2024
fe50364
Create jumbotron.php
crftwrk Apr 28, 2024
1245dde
Improve grid patterns
crftwrk Apr 29, 2024
fe5a08a
Improve patterns
crftwrk Apr 29, 2024
b79d398
Add btn-outline-* patterns
crftwrk Apr 29, 2024
8406a95
Create hero patterns
crftwrk Apr 29, 2024
74d9bcd
Improved heroes
crftwrk Apr 29, 2024
eadb014
Fix separator
crftwrk Apr 30, 2024
16bfd41
Added container pattern
crftwrk Apr 30, 2024
f874cf2
Added section with heading and pricing pattern
crftwrk May 2, 2024
3035f55
Created left and right aligned hero
crftwrk May 2, 2024
f3da923
Merge pull request #763 from bootscore/main
crftwrk May 5, 2024
4d36cce
Update alerts and buttons
crftwrk May 6, 2024
10d54b6
Updated cards
crftwrk May 6, 2024
fdc7b4a
Improved cards
crftwrk May 6, 2024
6a9f814
Improved Jumbotron
crftwrk May 6, 2024
9763d86
Create card-categories.php
crftwrk May 6, 2024
d12dcce
Removed bottom margin
crftwrk May 6, 2024
e3bd2a4
Update _blocks.scss
crftwrk May 19, 2024
8231258
Merge pull request #790 from bootscore/main
crftwrk Jun 7, 2024
d00b490
Update pricing.php
crftwrk Jun 12, 2024
a96fa48
Improved the patterns
crftwrk Jun 12, 2024
2c89e55
Improve editor style enqueue to use variables in theme.json
crftwrk Jun 18, 2024
29a236c
Improve editor style enqueue script
crftwrk Jun 18, 2024
8f43c7d
Merge pull request #793 from bootscore/Improve-editor-styles-enqueue-…
crftwrk Jun 18, 2024
4ca8eab
Clean-up alerts
crftwrk Jun 18, 2024
a79a7e3
Improve alerts
crftwrk Jun 19, 2024
5f0398f
Improve buttons
crftwrk Jun 19, 2024
5301c07
Improved cards
crftwrk Jun 19, 2024
333bd32
Improve container and grid patterns
crftwrk Jun 19, 2024
0130e94
Improved heroes
crftwrk Jun 19, 2024
b0dfb06
Improve sections
crftwrk Jun 19, 2024
3e9fc45
Merge pull request #794 from bootscore/Improve-patterns
crftwrk Jun 21, 2024
8d637ab
Register admin.css
crftwrk Jun 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions assets/admin/css/admin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*--------------------------------------------------------------
admin.css
Fix minor CSS issues in the backend editor screen
See /inc/enqueue.php
--------------------------------------------------------------*/

/* Fix pattern prreview iframe */
.block-editor-block-preview__content iframe {
max-width: 1200px;
}
2 changes: 1 addition & 1 deletion assets/scss/_bootscore-style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
@import "bootscore/utilities";
@import "bootscore/widgets";

@import "bootscore/blocks/block-widgets";
@import "bootscore/blocks/blocks";
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,31 @@
Block Widgets
--------------------------------------------------------------*/

// List groups
// Reset WP margin-top
:where(body .is-layout-flow) > * {
margin-block-start: 0 !important;
}


// Add rounded to block img if class added to img block
.rounded img {
border-radius: var(--#{$prefix}border-radius);
}

// Add card-img-top to block img if class added to img block
.card-img-top img {
border-top-left-radius: $card-inner-border-radius;
border-top-right-radius: $card-inner-border-radius;
}


// Separator
.wp-block-separator {
border-top: var(--#{$prefix}border-width) solid;
}


// List-groups
.bs-list-group {
.list-group-item-action {
a {
Expand All @@ -20,10 +44,10 @@ Block Widgets
color: $list-group-active-color;
}
}

}
}

// List-group in card
.card {
.bs-list-group.list-group-flush {
.list-group-item:last-child {
Expand Down
20 changes: 20 additions & 0 deletions inc/enqueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,26 @@ function bootscore_scripts() {
add_action('wp_enqueue_scripts', 'bootscore_scripts');



/*
* Register compiled CSS to editor
*/
function bootscore_add_editor_styles() {
add_theme_support('editor-styles');
add_editor_style('assets/css/main.css');

// Check if the current page is the Gutenberg editor and enqueue CSS to tha main admin area to use variables in theme.json
$screen = get_current_screen();
if ($screen && $screen->is_block_editor) {
wp_enqueue_style('main-editor-style', get_stylesheet_directory_uri() . '/assets/css/main.css', array(), '1.0', 'all');
// Fix minor CSS issues in the backend editor screen
wp_enqueue_style('admin-style', get_template_directory_uri() . '/assets/admin/css/admin.css', array(), '1.0', 'all');
}
}
add_action('enqueue_block_editor_assets', 'bootscore_add_editor_styles');



/**
* Preload Font Awesome
*/
Expand Down
10 changes: 9 additions & 1 deletion inc/theme-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,15 @@ function bootscore_setup() {
/*
* Add theme support for block template-parts.
*/
add_theme_support( 'block-template-parts' );
add_theme_support( 'block-template-parts' );

/*
* Register pattern category
*/
register_block_pattern_category(
'bootscore',
array( 'label' => __( 'Bootscore', 'bootscore' ) )
);
}
endif;
add_action('after_setup_theme', 'bootscore_setup');
Expand Down
18 changes: 18 additions & 0 deletions patterns/alert-danger.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Title: alert-danger with icon and dismiss button
* Slug: bootscore/alert-danger
* Categories: bootscore
* https://developer.wordpress.org/themes/features/block-patterns/
*
* @package Bootscore
* @version 6.0.0
*/

// Exit if accessed directly
defined('ABSPATH') || exit;

?>
<!-- wp:paragraph {"metadata":{"name":"alert-danger"},"className":"alert alert-danger alert-icon alert-danger-icon alert-dismissible fade show"} -->
<p class="alert alert-danger alert-icon alert-danger-icon alert-dismissible fade show">A dismissing danger alert with an icon and a <a href="#">link</a>.<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button></p>
<!-- /wp:paragraph -->
18 changes: 18 additions & 0 deletions patterns/alert-info.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Title: alert-info
* Slug: bootscore/alert-info
* Categories: bootscore
* https://developer.wordpress.org/themes/features/block-patterns/
*
* @package Bootscore
* @version 6.0.0
*/

// Exit if accessed directly
defined('ABSPATH') || exit;

?>
<!-- wp:paragraph {"metadata":{"name":"alert-info"},"className":"alert alert-info"} -->
<p class="alert alert-info">A simple info alert with a <a href="#">link</a>.</p>
<!-- /wp:paragraph -->
18 changes: 18 additions & 0 deletions patterns/btn-danger-lg.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Title: btn-danger-lg
* Slug: bootscore/btn-danger-lg
* Categories: bootscore
* https://developer.wordpress.org/themes/features/block-patterns/
*
* @package Bootscore
* @version 6.0.0
*/

// Exit if accessed directly
defined('ABSPATH') || exit;

?>
<!-- wp:paragraph {"metadata":{"name":"btn-danger-lg"}} -->
<p><a class="btn btn-danger btn-lg" href="#">Button</a></p>
<!-- /wp:paragraph -->
18 changes: 18 additions & 0 deletions patterns/btn-outline-secondary-sm.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Title: btn-outline-secondary-sm
* Slug: bootscore/btn-outline-secondary-sm
* Categories: bootscore
* https://developer.wordpress.org/themes/features/block-patterns/
*
* @package Bootscore
* @version 6.0.0
*/

// Exit if accessed directly
defined('ABSPATH') || exit;

?>
<!-- wp:paragraph {"metadata":{"name":"btn-outline-secondary-sm"}} -->
<p><a class="btn btn-outline-secondary btn-sm" href="#">Button</a></p>
<!-- /wp:paragraph -->
18 changes: 18 additions & 0 deletions patterns/btn-primary.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Title: btn-primary
* Slug: bootscore/btn-primary
* Categories: bootscore
* https://developer.wordpress.org/themes/features/block-patterns/
*
* @package Bootscore
* @version 6.0.0
*/

// Exit if accessed directly
defined('ABSPATH') || exit;

?>
<!-- wp:paragraph {"metadata":{"name":"btn-primary"}} -->
<p><a class="btn btn-primary" href="#">Button</a></p>
<!-- /wp:paragraph -->
42 changes: 42 additions & 0 deletions patterns/card-advanced.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php
/**
* Title: card advanced
* Slug: bootscore/card-advanced
* Categories: bootscore
* https://developer.wordpress.org/themes/features/block-patterns/
*
* @package Bootscore
* @version 6.0.0
*/

// Exit if accessed directly
defined('ABSPATH') || exit;

?>
<!-- wp:group {"metadata":{"name":"card advanced"},"className":"card"} -->
<div class="wp-block-group card"><!-- wp:heading {"className":"card-header h6"} -->
<h2 class="wp-block-heading card-header h6">Card header</h2>
<!-- /wp:heading -->

<!-- wp:image {"sizeSlug":"large","className":"mb-0"} -->
<figure class="wp-block-image size-large mb-0"><img src="https://dummyimage.com/1200x900/6c757d/ffffff" alt=""/></figure>
<!-- /wp:image -->

<!-- wp:group {"className":"card-body","layout":{"type":"default"}} -->
<div class="wp-block-group card-body"><!-- wp:heading {"level":3,"className":"card-title h5"} -->
<h3 class="wp-block-heading card-title h5">Card title</h3>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":"card-text"} -->
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><a class="btn btn-primary" href="#">Button</a></p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->

<!-- wp:paragraph {"className":"card-footer"} -->
<p class="card-footer">Card footer</p>
<!-- /wp:paragraph --></div>
<!-- /wp:group -->
34 changes: 34 additions & 0 deletions patterns/card-basic.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/**
* Title: card basic
* Slug: bootscore/card-basic
* Categories: bootscore
* https://developer.wordpress.org/themes/features/block-patterns/
*
* @package Bootscore
* @version 6.0.0
*/

// Exit if accessed directly
defined('ABSPATH') || exit;

?>
<!-- wp:group {"metadata":{"name":"card basic"},"className":"card"} -->
<div class="wp-block-group card"><!-- wp:image {"sizeSlug":"large","className":"card-img-top mb-0"} -->
<figure class="wp-block-image size-large card-img-top mb-0"><img src="https://dummyimage.com/1200x900/6c757d/ffffff" alt=""/></figure>
<!-- /wp:image -->

<!-- wp:group {"className":"card-body","layout":{"type":"default"}} -->
<div class="wp-block-group card-body"><!-- wp:heading {"className":"card-title h5"} -->
<h2 class="wp-block-heading card-title h5">Card title</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><a class="btn btn-primary" href="#">Button</a></p>
<!-- /wp:paragraph --></div>
<!-- /wp:group --></div>
<!-- /wp:group -->
22 changes: 22 additions & 0 deletions patterns/card-categories.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* Title: card categories
* Slug: bootscore/card-categories
* Categories: bootscore
* https://developer.wordpress.org/themes/features/block-patterns/
*
* @package Bootscore
* @version 6.0.0
*/

// Exit if accessed directly
defined('ABSPATH') || exit;

?>
<!-- wp:group {"metadata":{"name":"card with categories"},"className":"card"} -->
<div class="wp-block-group card"><!-- wp:heading {"className":"card-header h6"} -->
<h2 class="wp-block-heading card-header h6">Categories</h2>
<!-- /wp:heading -->

<!-- wp:categories {"showPostCounts":true,"className":"list-group-flush"} /--></div>
<!-- /wp:group -->