Skip to content

Commit

Permalink
Add blocks/custom folder update build process and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
khleomix committed Jun 10, 2024
1 parent 0c22a3f commit 5be0a40
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ npm i && composer i

2. Create an SCSS file with the exact filename as the block name you want to customize. This file will house your custom styles for that specific core block.

3. Files within the `assets/scss/blocks/core` directory are automatically enqueued, simplifying the integration of your custom styles into the WordPress block editor.
3. Files within the `assets/scss/blocks/core` directory are automatically enqueued, simplifying the integration of your custom styles into the WordPress block editor. Do not import these files into the main `index.scss`

4. After adding your custom SCSS file, run the following command to compile and apply your changes:

Expand Down
3 changes: 3 additions & 0 deletions assets/scss/blocks/custom/_custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// 'blocks/custom/' is for styling custom blocks added by plugins
// (e.g., shareaholic etc)
// Files added here will be added to the built style.css.
1 change: 1 addition & 0 deletions assets/scss/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
@import './components/components';
@import './layout/layout';
@import './pages/pages';
@import './blocks/custom/custom';
10 changes: 9 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ License URI: https://www.gnu.org/licenses/gpl-3.0.html

== Description ==

Meet WDS BT, a stylish block theme, tailored for WordPress, featuring native blocks and site editor compatibility. Boasting a contemporary aesthetic, an intuitive interface, and seamless WordPress block editor integration, WDS BT ensures a polished and adaptable framework across all devices. It's crucial to understand that WDS BT is crafted as a foundational theme rather than a parent theme. This difference affords users a flexible starting point for customization. Elevate your website with WDS BT, where design effortlessly meets functionality, providing the ideal canvas for your creative expression.
Meet WDS BT, a stylish block theme, tailored for WordPress, featuring
native blocks and site editor compatibility. Boasting a contemporary
aesthetic, an intuitive interface, and seamless WordPress block editor
integration, WDS BT ensures a polished and adaptable framework across
all devices. It's crucial to understand that WDS BT is crafted as a
foundational theme rather than a parent theme. This difference affords
users a flexible starting point for customization. Elevate your website
with WDS BT, where design effortlessly meets functionality, providing
the ideal canvas for your creative expression.

== Copyright ==

Expand Down
4 changes: 2 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Theme Name: WDS BT
Theme URI: https://webdevstudios.com/
Author: WebDevStudios
Author URI: https://webdevstudios.com/
Description: Introducing WDS BT, a sleek block theme inspired by the Powder Theme. Designed as a versatile base theme, it offers a modern layout, user-friendly interface, and seamless integration with the WordPress block editor. Elevate your website effortlessly with WDS BT, where design meets functionality in a compact package.
Description: Meet WDS BT, a stylish block theme, tailored for WordPress, featuring native blocks and site editor compatibility.
Requires at least: 6.4
Tested up to: 6.4
Requires PHP: 8.2
Version: 0.1.0
License: GNU General Public License v3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: wdsbt
Tags: block-patterns, block-styles, custom-colors, custom-logo, custom-menu, e-commerce, editor-style, full-site-editing, one-column, style-variations, translation-ready, wide-blocks
Tags: block-patterns, block-styles, editor-style, full-site-editing, translation-ready
*/
5 changes: 2 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ const { glob } = require('glob');

// Dynamically generate entry points for each file inside 'assets/scss/blocks'
const coreBlockEntryPaths = glob
.sync('./assets/scss/blocks/**/*.scss', {
.sync('./assets/scss/blocks/core/*.scss', {
posix: true,
dotRelative: true,
})
.reduce((acc, filePath) => {
const entryKey = filePath.split(/[\\/]/).pop().replace('.scss', '');
const blockPath = filePath.split(/[\\/]/).slice(-2, -1)[0];
acc[`blocks/${blockPath}/${entryKey}`] = filePath;
acc[`blocks/core/${entryKey}`] = filePath;
return acc;
}, {});

Expand Down

0 comments on commit 5be0a40

Please sign in to comment.