From 01c67ac67e4a9b334227fb0a56805168f40801bb Mon Sep 17 00:00:00 2001 From: Dmitry Mayorov Date: Mon, 20 May 2024 19:44:20 -0400 Subject: [PATCH 1/8] Add autoload style functionality --- themes/10up-theme/includes/blocks.php | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/themes/10up-theme/includes/blocks.php b/themes/10up-theme/includes/blocks.php index 699d8b9..8390e67 100644 --- a/themes/10up-theme/includes/blocks.php +++ b/themes/10up-theme/includes/blocks.php @@ -21,6 +21,8 @@ function setup() { add_action( 'enqueue_block_editor_assets', $n( 'blocks_editor_styles' ) ); + add_action( 'init', $n( 'enqueue_block_specific_styles' ) ); + add_action( 'init', $n( 'register_theme_blocks' ) ); add_action( 'init', $n( 'register_block_pattern_categories' ) ); @@ -128,6 +130,52 @@ function blocks_editor_styles() { } } + +/** + * Enqueue block specific styles. + * + * This function is used to enqueue styles that are specific to a block. It + * first gets all the CSS files in the 'blocks/autoenqueue' directory. Then + * for each stylesheet, it determines the block type by removing the directory + * path and '.css' from the stylesheet path. It then tries to get the asset + * file for the block type. If the asset file doesn't exist, it creates a new + * one with the version set to the file modification time of the stylesheet + * and no dependencies. Finally, it enqueues the block style using the block + * type, the URL to the stylesheet, the path to the stylesheet, the version + * from the asset file, and the dependencies from the asset file. + * + * @return void + */ +function enqueue_block_specific_styles() { + $stylesheets = glob( TENUP_THEME_DIST_PATH . '/blocks/autoenqueue/*.css' ); + + foreach ( $stylesheets as $stylesheet_path ) { + $block_type = str_replace( TENUP_THEME_DIST_PATH . '/blocks/autoenqueue/', '', $stylesheet_path ); + $block_type = str_replace( '.css', '', $block_type ); + $asset_file = TENUP_THEME_DIST_PATH . 'blocks/autoenqueue/' . $block_type . '.asset.php'; + + if ( ! file_exists( $asset_file ) ) { + $asset_file = require $asset_file; + } else { + $asset_file = [ + 'version' => filemtime( $stylesheet_path ), + 'dependencies' => [], + ]; + } + + wp_enqueue_block_style( + $block_type, + [ + 'handle' => "{$block_type}", + 'src' => TENUP_THEME_DIST_URL . 'blocks/autoenqueue/' . $block_type . '.css', + 'path' => $stylesheet_path, + 'version' => $asset_file['version'], + 'dependencies' => $asset_file['dependencies'], + ] + ); + } +} + /** * Register block pattern categories * From 290815e423c7a71afe3f2047a97d3f4bf7045f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Tue, 24 Sep 2024 07:50:57 +0200 Subject: [PATCH 2/8] implement changes --- themes/10up-theme/includes/blocks.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/themes/10up-theme/includes/blocks.php b/themes/10up-theme/includes/blocks.php index 8390e67..fceaf1d 100644 --- a/themes/10up-theme/includes/blocks.php +++ b/themes/10up-theme/includes/blocks.php @@ -163,14 +163,20 @@ function enqueue_block_specific_styles() { ]; } + [$block_namespace, $block_name] = explode( '/', $block_type ); + + wp_register_style( + "tenup-theme-{$block_namespace}-{$block_name}", + TENUP_THEME_DIST_URL . 'blocks/autoenqueue/' . $block_type . '.css', + $asset_file['version'], + $asset_file['dependencies'], + ); + wp_enqueue_block_style( $block_type, [ - 'handle' => "{$block_type}", - 'src' => TENUP_THEME_DIST_URL . 'blocks/autoenqueue/' . $block_type . '.css', + 'handle' => "tenup-theme-{$block_namespace}-{$block_name}", 'path' => $stylesheet_path, - 'version' => $asset_file['version'], - 'dependencies' => $asset_file['dependencies'], ] ); } From 937d417522808496d1c978576e303c7f48a0b9b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Tue, 24 Sep 2024 07:52:41 +0200 Subject: [PATCH 3/8] fix indentation --- themes/10up-theme/includes/blocks.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/10up-theme/includes/blocks.php b/themes/10up-theme/includes/blocks.php index fceaf1d..4372ba3 100644 --- a/themes/10up-theme/includes/blocks.php +++ b/themes/10up-theme/includes/blocks.php @@ -166,10 +166,10 @@ function enqueue_block_specific_styles() { [$block_namespace, $block_name] = explode( '/', $block_type ); wp_register_style( - "tenup-theme-{$block_namespace}-{$block_name}", - TENUP_THEME_DIST_URL . 'blocks/autoenqueue/' . $block_type . '.css', - $asset_file['version'], - $asset_file['dependencies'], + "tenup-theme-{$block_namespace}-{$block_name}", + TENUP_THEME_DIST_URL . 'blocks/autoenqueue/' . $block_type . '.css', + $asset_file['version'], + $asset_file['dependencies'], ); wp_enqueue_block_style( From e789b338f0f7b8a9d6eae2c7bd60a13a9b997434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Tue, 24 Sep 2024 07:54:12 +0200 Subject: [PATCH 4/8] enable loadBlockSpecificStyles option of toolkit --- themes/10up-theme/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/10up-theme/package.json b/themes/10up-theme/package.json index ea70a9b..76945d3 100644 --- a/themes/10up-theme/package.json +++ b/themes/10up-theme/package.json @@ -23,6 +23,7 @@ }, "10up-toolkit": { "useBlockAssets": true, + "loadBlockSpecificStyles": true, "entry": { "admin": "./assets/js/admin/admin.js", "editor-style-overrides": "./assets/js/admin/editor-style-overrides.js", From 0c6ea5890b36f14a58bce7cb6690f1bd069bde0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Tue, 24 Sep 2024 09:37:29 +0200 Subject: [PATCH 5/8] update toolkit to prerelease version 6.3 --- mu-plugins/10up-plugin/package.json | 10 +- package-lock.json | 430 +++++++++++++++++++++++++++- themes/10up-theme/package.json | 2 +- 3 files changed, 434 insertions(+), 8 deletions(-) diff --git a/mu-plugins/10up-plugin/package.json b/mu-plugins/10up-plugin/package.json index d4db2ef..b8ccb14 100644 --- a/mu-plugins/10up-plugin/package.json +++ b/mu-plugins/10up-plugin/package.json @@ -15,7 +15,7 @@ "node": ">=18.0.0" }, "devDependencies": { - "10up-toolkit": "^6.2.0" + "10up-toolkit": "^6.3.0-next.0" }, "dependencies": { "prop-types": "^15.7.2" @@ -26,9 +26,9 @@ "frontend": "./assets/js/frontend/frontend.js", "shared": "./assets/js/shared/shared.js" }, - "paths": { - "globalStylesDir": "../../themes/10up-theme/assets/css/globals/", - "globalMixinsDir": "../../themes/10up-theme/assets/css/globals/mixins/" - } + "paths": { + "globalStylesDir": "../../themes/10up-theme/assets/css/globals/", + "globalMixinsDir": "../../themes/10up-theme/assets/css/globals/mixins/" + } } } diff --git a/package-lock.json b/package-lock.json index 33480a3..69e36cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,12 +31,225 @@ "prop-types": "^15.7.2" }, "devDependencies": { - "10up-toolkit": "^6.2.0" + "10up-toolkit": "^6.3.0-next.0" }, "engines": { "node": ">=18.0.0" } }, + "mu-plugins/10up-plugin/node_modules/10up-toolkit": { + "version": "6.3.0-next.0", + "resolved": "https://registry.npmjs.org/10up-toolkit/-/10up-toolkit-6.3.0-next.0.tgz", + "integrity": "sha512-tGVacp81VYt+1X42Rs3wWiYVfTTFtg1dsCLIzUGIHvYAyoJ4VJtsuQ5LsII+zp+w1XCmryUrP9VDaleylNeRAQ==", + "dev": true, + "license": "GPL-2.0-or-later", + "dependencies": { + "@babel/eslint-parser": "^7.23.3", + "@csstools/postcss-global-data": "^2.1.1", + "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", + "@svgr/webpack": "^8.1.0", + "@typescript-eslint/eslint-plugin": "^6.17.0", + "@typescript-eslint/parser": "^6.17.0", + "@wordpress/dependency-extraction-webpack-plugin": "^5.4.0", + "@wordpress/eslint-plugin": "^17.5.0", + "@wordpress/jest-console": "^7.19.0", + "babel-jest": "^29.7.0", + "babel-loader": "^9.1.3", + "camelcase": "^6.3.0", + "chalk": "^4.0.0", + "copy-webpack-plugin": "^11.0.0", + "core-js": "^3.35.0", + "core-js-pure": "^3.35.0", + "cross-spawn": "^7.0.3", + "css-loader": "^6.8.1", + "cssnano": "^6.0.3", + "error-stack-parser": "^2.1.4", + "eslint-webpack-plugin": "^4.0.1", + "fast-glob": "^3.3.2", + "html-webpack-plugin": "^5.6.0", + "ignore-emit-webpack-plugin": "^2.0.6", + "image-minimizer-webpack-plugin": "^3.8.3", + "inquirer": "^8.2.6", + "jest": "^29.7.0", + "mini-css-extract-plugin": "^2.7.6", + "minimist": "^1.2.8", + "node-fetch": "^2.7.0", + "postcss": "^8.4.31", + "postcss-editor-styles-wrapper": "^1.0.1", + "postcss-import": "^15.1.0", + "postcss-loader": "^7.3.3", + "postcss-mixins": "^9.0.4", + "postcss-preset-env": "^9.3.0", + "react-refresh": "^0.14.0", + "read-pkg": "^5.2.0", + "read-pkg-up": "^7.0.1", + "resolve-bin": "^1.0.1", + "sass": "^1.69.7", + "sass-loader": "^13.3.3", + "sharp": "0.32.6", + "stylelint-config-standard-scss": "^11.0.0", + "stylelint-webpack-plugin": "^4.1.1", + "svgo": "^3.2.0", + "url-loader": "^4.1.1", + "webpack": "^5.89.0", + "webpack-bundle-analyzer": "^4.10.1", + "webpack-dev-server": "^4.15.1", + "webpack-sources": "^3.2.3", + "webpackbar": "^6.0.0", + "yaml": "^2.4.1" + }, + "bin": { + "10up-toolkit": "bin/10up-toolkit.js" + }, + "engines": { + "node": ">=16", + "npm": ">=6.9" + }, + "peerDependencies": { + "@10up/babel-preset-default": ">=2.1.1", + "@10up/eslint-config": ">=4.1.0-next.0", + "@10up/stylelint-config": ">=3.0.0", + "@linaria/babel-preset": ">=4.3.3", + "@linaria/webpack-loader": ">=4.1.11", + "typescript": ">=5.0.0" + }, + "peerDependenciesMeta": { + "@linaria/babel-preset": { + "optional": true + }, + "@linaria/webpack-loader": { + "optional": true + } + } + }, + "mu-plugins/10up-plugin/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "mu-plugins/10up-plugin/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "mu-plugins/10up-plugin/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "mu-plugins/10up-plugin/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "mu-plugins/10up-plugin/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "mu-plugins/10up-plugin/node_modules/inquirer": { + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", + "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^6.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "mu-plugins/10up-plugin/node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "mu-plugins/10up-plugin/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "mu-plugins/10up-plugin/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/@10up/babel-preset-default": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@10up/babel-preset-default/-/babel-preset-default-2.1.1.tgz", @@ -21346,11 +21559,224 @@ "modern-normalize": "^2.0.0" }, "devDependencies": { - "10up-toolkit": "^6.2.0" + "10up-toolkit": "^6.3.0-next.0" }, "engines": { "node": ">=18.0.0" } + }, + "themes/10up-theme/node_modules/10up-toolkit": { + "version": "6.3.0-next.0", + "resolved": "https://registry.npmjs.org/10up-toolkit/-/10up-toolkit-6.3.0-next.0.tgz", + "integrity": "sha512-tGVacp81VYt+1X42Rs3wWiYVfTTFtg1dsCLIzUGIHvYAyoJ4VJtsuQ5LsII+zp+w1XCmryUrP9VDaleylNeRAQ==", + "dev": true, + "license": "GPL-2.0-or-later", + "dependencies": { + "@babel/eslint-parser": "^7.23.3", + "@csstools/postcss-global-data": "^2.1.1", + "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", + "@svgr/webpack": "^8.1.0", + "@typescript-eslint/eslint-plugin": "^6.17.0", + "@typescript-eslint/parser": "^6.17.0", + "@wordpress/dependency-extraction-webpack-plugin": "^5.4.0", + "@wordpress/eslint-plugin": "^17.5.0", + "@wordpress/jest-console": "^7.19.0", + "babel-jest": "^29.7.0", + "babel-loader": "^9.1.3", + "camelcase": "^6.3.0", + "chalk": "^4.0.0", + "copy-webpack-plugin": "^11.0.0", + "core-js": "^3.35.0", + "core-js-pure": "^3.35.0", + "cross-spawn": "^7.0.3", + "css-loader": "^6.8.1", + "cssnano": "^6.0.3", + "error-stack-parser": "^2.1.4", + "eslint-webpack-plugin": "^4.0.1", + "fast-glob": "^3.3.2", + "html-webpack-plugin": "^5.6.0", + "ignore-emit-webpack-plugin": "^2.0.6", + "image-minimizer-webpack-plugin": "^3.8.3", + "inquirer": "^8.2.6", + "jest": "^29.7.0", + "mini-css-extract-plugin": "^2.7.6", + "minimist": "^1.2.8", + "node-fetch": "^2.7.0", + "postcss": "^8.4.31", + "postcss-editor-styles-wrapper": "^1.0.1", + "postcss-import": "^15.1.0", + "postcss-loader": "^7.3.3", + "postcss-mixins": "^9.0.4", + "postcss-preset-env": "^9.3.0", + "react-refresh": "^0.14.0", + "read-pkg": "^5.2.0", + "read-pkg-up": "^7.0.1", + "resolve-bin": "^1.0.1", + "sass": "^1.69.7", + "sass-loader": "^13.3.3", + "sharp": "0.32.6", + "stylelint-config-standard-scss": "^11.0.0", + "stylelint-webpack-plugin": "^4.1.1", + "svgo": "^3.2.0", + "url-loader": "^4.1.1", + "webpack": "^5.89.0", + "webpack-bundle-analyzer": "^4.10.1", + "webpack-dev-server": "^4.15.1", + "webpack-sources": "^3.2.3", + "webpackbar": "^6.0.0", + "yaml": "^2.4.1" + }, + "bin": { + "10up-toolkit": "bin/10up-toolkit.js" + }, + "engines": { + "node": ">=16", + "npm": ">=6.9" + }, + "peerDependencies": { + "@10up/babel-preset-default": ">=2.1.1", + "@10up/eslint-config": ">=4.1.0-next.0", + "@10up/stylelint-config": ">=3.0.0", + "@linaria/babel-preset": ">=4.3.3", + "@linaria/webpack-loader": ">=4.1.11", + "typescript": ">=5.0.0" + }, + "peerDependenciesMeta": { + "@linaria/babel-preset": { + "optional": true + }, + "@linaria/webpack-loader": { + "optional": true + } + } + }, + "themes/10up-theme/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "themes/10up-theme/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "themes/10up-theme/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "themes/10up-theme/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "themes/10up-theme/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "themes/10up-theme/node_modules/inquirer": { + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", + "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^6.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "themes/10up-theme/node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "themes/10up-theme/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "themes/10up-theme/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } } } } diff --git a/themes/10up-theme/package.json b/themes/10up-theme/package.json index 76945d3..8cdf8b6 100644 --- a/themes/10up-theme/package.json +++ b/themes/10up-theme/package.json @@ -16,7 +16,7 @@ "node": ">=18.0.0" }, "devDependencies": { - "10up-toolkit": "^6.2.0" + "10up-toolkit": "^6.3.0-next.0" }, "dependencies": { "modern-normalize": "^2.0.0" From ad888a7ed969d848e6b2e47a84410f7ef3ace2b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Tue, 24 Sep 2024 09:43:00 +0200 Subject: [PATCH 6/8] fix block style path --- themes/10up-theme/includes/blocks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/10up-theme/includes/blocks.php b/themes/10up-theme/includes/blocks.php index 4372ba3..b46246b 100644 --- a/themes/10up-theme/includes/blocks.php +++ b/themes/10up-theme/includes/blocks.php @@ -147,10 +147,10 @@ function blocks_editor_styles() { * @return void */ function enqueue_block_specific_styles() { - $stylesheets = glob( TENUP_THEME_DIST_PATH . '/blocks/autoenqueue/*.css' ); + $stylesheets = glob( TENUP_THEME_DIST_PATH . 'blocks/autoenqueue/**/*.css' ); foreach ( $stylesheets as $stylesheet_path ) { - $block_type = str_replace( TENUP_THEME_DIST_PATH . '/blocks/autoenqueue/', '', $stylesheet_path ); + $block_type = str_replace( TENUP_THEME_DIST_PATH . 'blocks/autoenqueue/', '', $stylesheet_path ); $block_type = str_replace( '.css', '', $block_type ); $asset_file = TENUP_THEME_DIST_PATH . 'blocks/autoenqueue/' . $block_type . '.asset.php'; From 2d70dcb8aed76d43f2361284fd4da5d0e701929a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Tue, 24 Sep 2024 09:45:33 +0200 Subject: [PATCH 7/8] add example for block styles --- themes/10up-theme/assets/css/blocks/core/group.css | 3 +++ themes/10up-theme/assets/css/blocks/example-block.css | 3 --- themes/10up-theme/assets/css/blocks/index.css | 7 ------- themes/10up-theme/assets/css/blocks/readme.md | 7 +++++++ themes/10up-theme/assets/css/frontend/style.css | 4 ---- 5 files changed, 10 insertions(+), 14 deletions(-) create mode 100644 themes/10up-theme/assets/css/blocks/core/group.css delete mode 100644 themes/10up-theme/assets/css/blocks/example-block.css delete mode 100644 themes/10up-theme/assets/css/blocks/index.css create mode 100644 themes/10up-theme/assets/css/blocks/readme.md diff --git a/themes/10up-theme/assets/css/blocks/core/group.css b/themes/10up-theme/assets/css/blocks/core/group.css new file mode 100644 index 0000000..657486b --- /dev/null +++ b/themes/10up-theme/assets/css/blocks/core/group.css @@ -0,0 +1,3 @@ +.wp-block-group { + +} diff --git a/themes/10up-theme/assets/css/blocks/example-block.css b/themes/10up-theme/assets/css/blocks/example-block.css deleted file mode 100644 index e120b5f..0000000 --- a/themes/10up-theme/assets/css/blocks/example-block.css +++ /dev/null @@ -1,3 +0,0 @@ -/** - * Example block styles - */ diff --git a/themes/10up-theme/assets/css/blocks/index.css b/themes/10up-theme/assets/css/blocks/index.css deleted file mode 100644 index 8e3689b..0000000 --- a/themes/10up-theme/assets/css/blocks/index.css +++ /dev/null @@ -1,7 +0,0 @@ -/** - * TenUpTheme: Block styles - * https://project-website.tld - * - */ - -/* @import url("example-block.css"); */ diff --git a/themes/10up-theme/assets/css/blocks/readme.md b/themes/10up-theme/assets/css/blocks/readme.md new file mode 100644 index 0000000..e5ecca8 --- /dev/null +++ b/themes/10up-theme/assets/css/blocks/readme.md @@ -0,0 +1,7 @@ +# Block Specific Styles + +This directory contains block-specific styles. And file you create in this directory will be automatically included in the editor and on the front end when the block is used. The file should be named after the blocks name and be placed in a directory named after the blocks namespace. + +So if you have some styles you want to only load when the `core/paragraph` block is used, you would create a file at `wp-content/themes/10up-theme/assets/css/blocks/core/paragraph.css`. + +Similarly if you work with a block from a plugin that has a namespace of `acme`, you would create a file at `wp-content/themes/10up-theme/assets/css/blocks/acme/block-name.css`. diff --git a/themes/10up-theme/assets/css/frontend/style.css b/themes/10up-theme/assets/css/frontend/style.css index 5748d1b..e180b75 100755 --- a/themes/10up-theme/assets/css/frontend/style.css +++ b/themes/10up-theme/assets/css/frontend/style.css @@ -31,7 +31,3 @@ /* Components */ @import url("components/index.css"); - -/* Gutenberg blocks */ - -/* @import url("../blocks/index.css"); */ From 6a67118d1d9043cb909d7787da6d304e4fdcb5ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Thu, 26 Sep 2024 11:15:21 +0200 Subject: [PATCH 8/8] fix updates --- mu-plugins/10up-plugin/package.json | 2 +- package-lock.json | 437 +------------------------- themes/10up-theme/includes/blocks.php | 4 +- themes/10up-theme/package.json | 2 +- 4 files changed, 10 insertions(+), 435 deletions(-) diff --git a/mu-plugins/10up-plugin/package.json b/mu-plugins/10up-plugin/package.json index b8ccb14..74b9d4e 100644 --- a/mu-plugins/10up-plugin/package.json +++ b/mu-plugins/10up-plugin/package.json @@ -15,7 +15,7 @@ "node": ">=18.0.0" }, "devDependencies": { - "10up-toolkit": "^6.3.0-next.0" + "10up-toolkit": "^6.3.0" }, "dependencies": { "prop-types": "^15.7.2" diff --git a/package-lock.json b/package-lock.json index 69e36cf..09b371f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,225 +31,12 @@ "prop-types": "^15.7.2" }, "devDependencies": { - "10up-toolkit": "^6.3.0-next.0" + "10up-toolkit": "^6.3.0" }, "engines": { "node": ">=18.0.0" } }, - "mu-plugins/10up-plugin/node_modules/10up-toolkit": { - "version": "6.3.0-next.0", - "resolved": "https://registry.npmjs.org/10up-toolkit/-/10up-toolkit-6.3.0-next.0.tgz", - "integrity": "sha512-tGVacp81VYt+1X42Rs3wWiYVfTTFtg1dsCLIzUGIHvYAyoJ4VJtsuQ5LsII+zp+w1XCmryUrP9VDaleylNeRAQ==", - "dev": true, - "license": "GPL-2.0-or-later", - "dependencies": { - "@babel/eslint-parser": "^7.23.3", - "@csstools/postcss-global-data": "^2.1.1", - "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", - "@svgr/webpack": "^8.1.0", - "@typescript-eslint/eslint-plugin": "^6.17.0", - "@typescript-eslint/parser": "^6.17.0", - "@wordpress/dependency-extraction-webpack-plugin": "^5.4.0", - "@wordpress/eslint-plugin": "^17.5.0", - "@wordpress/jest-console": "^7.19.0", - "babel-jest": "^29.7.0", - "babel-loader": "^9.1.3", - "camelcase": "^6.3.0", - "chalk": "^4.0.0", - "copy-webpack-plugin": "^11.0.0", - "core-js": "^3.35.0", - "core-js-pure": "^3.35.0", - "cross-spawn": "^7.0.3", - "css-loader": "^6.8.1", - "cssnano": "^6.0.3", - "error-stack-parser": "^2.1.4", - "eslint-webpack-plugin": "^4.0.1", - "fast-glob": "^3.3.2", - "html-webpack-plugin": "^5.6.0", - "ignore-emit-webpack-plugin": "^2.0.6", - "image-minimizer-webpack-plugin": "^3.8.3", - "inquirer": "^8.2.6", - "jest": "^29.7.0", - "mini-css-extract-plugin": "^2.7.6", - "minimist": "^1.2.8", - "node-fetch": "^2.7.0", - "postcss": "^8.4.31", - "postcss-editor-styles-wrapper": "^1.0.1", - "postcss-import": "^15.1.0", - "postcss-loader": "^7.3.3", - "postcss-mixins": "^9.0.4", - "postcss-preset-env": "^9.3.0", - "react-refresh": "^0.14.0", - "read-pkg": "^5.2.0", - "read-pkg-up": "^7.0.1", - "resolve-bin": "^1.0.1", - "sass": "^1.69.7", - "sass-loader": "^13.3.3", - "sharp": "0.32.6", - "stylelint-config-standard-scss": "^11.0.0", - "stylelint-webpack-plugin": "^4.1.1", - "svgo": "^3.2.0", - "url-loader": "^4.1.1", - "webpack": "^5.89.0", - "webpack-bundle-analyzer": "^4.10.1", - "webpack-dev-server": "^4.15.1", - "webpack-sources": "^3.2.3", - "webpackbar": "^6.0.0", - "yaml": "^2.4.1" - }, - "bin": { - "10up-toolkit": "bin/10up-toolkit.js" - }, - "engines": { - "node": ">=16", - "npm": ">=6.9" - }, - "peerDependencies": { - "@10up/babel-preset-default": ">=2.1.1", - "@10up/eslint-config": ">=4.1.0-next.0", - "@10up/stylelint-config": ">=3.0.0", - "@linaria/babel-preset": ">=4.3.3", - "@linaria/webpack-loader": ">=4.1.11", - "typescript": ">=5.0.0" - }, - "peerDependenciesMeta": { - "@linaria/babel-preset": { - "optional": true - }, - "@linaria/webpack-loader": { - "optional": true - } - } - }, - "mu-plugins/10up-plugin/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "mu-plugins/10up-plugin/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "mu-plugins/10up-plugin/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "mu-plugins/10up-plugin/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "mu-plugins/10up-plugin/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "mu-plugins/10up-plugin/node_modules/inquirer": { - "version": "8.2.6", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", - "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.1", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.21", - "mute-stream": "0.0.8", - "ora": "^5.4.1", - "run-async": "^2.4.0", - "rxjs": "^7.5.5", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6", - "wrap-ansi": "^6.0.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "mu-plugins/10up-plugin/node_modules/rxjs": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.1.0" - } - }, - "mu-plugins/10up-plugin/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "mu-plugins/10up-plugin/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@10up/babel-preset-default": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/@10up/babel-preset-default/-/babel-preset-default-2.1.1.tgz", @@ -5763,10 +5550,11 @@ "dev": true }, "node_modules/10up-toolkit": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/10up-toolkit/-/10up-toolkit-6.2.0.tgz", - "integrity": "sha512-fNBTD6EAMTwskbsg90c2EKNZ48XyaA63sLDW5SnEfkiP4grblNHU1NObCIS+l5bAkUF3qFKgU4Q6gxgamvUZ6Q==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/10up-toolkit/-/10up-toolkit-6.3.0.tgz", + "integrity": "sha512-ubRo+y+amPVPw0CYE1sPW3GJicQYUiHUORzTRJO8/nCepLNjCwT3lB7HDGLBvKeSgG9+rF6QK+D5NLe0Ekp5gw==", "dev": true, + "license": "GPL-2.0-or-later", "dependencies": { "@babel/eslint-parser": "^7.23.3", "@csstools/postcss-global-data": "^2.1.1", @@ -21559,224 +21347,11 @@ "modern-normalize": "^2.0.0" }, "devDependencies": { - "10up-toolkit": "^6.3.0-next.0" + "10up-toolkit": "^6.3.0" }, "engines": { "node": ">=18.0.0" } - }, - "themes/10up-theme/node_modules/10up-toolkit": { - "version": "6.3.0-next.0", - "resolved": "https://registry.npmjs.org/10up-toolkit/-/10up-toolkit-6.3.0-next.0.tgz", - "integrity": "sha512-tGVacp81VYt+1X42Rs3wWiYVfTTFtg1dsCLIzUGIHvYAyoJ4VJtsuQ5LsII+zp+w1XCmryUrP9VDaleylNeRAQ==", - "dev": true, - "license": "GPL-2.0-or-later", - "dependencies": { - "@babel/eslint-parser": "^7.23.3", - "@csstools/postcss-global-data": "^2.1.1", - "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", - "@svgr/webpack": "^8.1.0", - "@typescript-eslint/eslint-plugin": "^6.17.0", - "@typescript-eslint/parser": "^6.17.0", - "@wordpress/dependency-extraction-webpack-plugin": "^5.4.0", - "@wordpress/eslint-plugin": "^17.5.0", - "@wordpress/jest-console": "^7.19.0", - "babel-jest": "^29.7.0", - "babel-loader": "^9.1.3", - "camelcase": "^6.3.0", - "chalk": "^4.0.0", - "copy-webpack-plugin": "^11.0.0", - "core-js": "^3.35.0", - "core-js-pure": "^3.35.0", - "cross-spawn": "^7.0.3", - "css-loader": "^6.8.1", - "cssnano": "^6.0.3", - "error-stack-parser": "^2.1.4", - "eslint-webpack-plugin": "^4.0.1", - "fast-glob": "^3.3.2", - "html-webpack-plugin": "^5.6.0", - "ignore-emit-webpack-plugin": "^2.0.6", - "image-minimizer-webpack-plugin": "^3.8.3", - "inquirer": "^8.2.6", - "jest": "^29.7.0", - "mini-css-extract-plugin": "^2.7.6", - "minimist": "^1.2.8", - "node-fetch": "^2.7.0", - "postcss": "^8.4.31", - "postcss-editor-styles-wrapper": "^1.0.1", - "postcss-import": "^15.1.0", - "postcss-loader": "^7.3.3", - "postcss-mixins": "^9.0.4", - "postcss-preset-env": "^9.3.0", - "react-refresh": "^0.14.0", - "read-pkg": "^5.2.0", - "read-pkg-up": "^7.0.1", - "resolve-bin": "^1.0.1", - "sass": "^1.69.7", - "sass-loader": "^13.3.3", - "sharp": "0.32.6", - "stylelint-config-standard-scss": "^11.0.0", - "stylelint-webpack-plugin": "^4.1.1", - "svgo": "^3.2.0", - "url-loader": "^4.1.1", - "webpack": "^5.89.0", - "webpack-bundle-analyzer": "^4.10.1", - "webpack-dev-server": "^4.15.1", - "webpack-sources": "^3.2.3", - "webpackbar": "^6.0.0", - "yaml": "^2.4.1" - }, - "bin": { - "10up-toolkit": "bin/10up-toolkit.js" - }, - "engines": { - "node": ">=16", - "npm": ">=6.9" - }, - "peerDependencies": { - "@10up/babel-preset-default": ">=2.1.1", - "@10up/eslint-config": ">=4.1.0-next.0", - "@10up/stylelint-config": ">=3.0.0", - "@linaria/babel-preset": ">=4.3.3", - "@linaria/webpack-loader": ">=4.1.11", - "typescript": ">=5.0.0" - }, - "peerDependenciesMeta": { - "@linaria/babel-preset": { - "optional": true - }, - "@linaria/webpack-loader": { - "optional": true - } - } - }, - "themes/10up-theme/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "themes/10up-theme/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "themes/10up-theme/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "themes/10up-theme/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true, - "license": "MIT" - }, - "themes/10up-theme/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "themes/10up-theme/node_modules/inquirer": { - "version": "8.2.6", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", - "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-escapes": "^4.2.1", - "chalk": "^4.1.1", - "cli-cursor": "^3.1.0", - "cli-width": "^3.0.0", - "external-editor": "^3.0.3", - "figures": "^3.0.0", - "lodash": "^4.17.21", - "mute-stream": "0.0.8", - "ora": "^5.4.1", - "run-async": "^2.4.0", - "rxjs": "^7.5.5", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0", - "through": "^2.3.6", - "wrap-ansi": "^6.0.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "themes/10up-theme/node_modules/rxjs": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "tslib": "^2.1.0" - } - }, - "themes/10up-theme/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "themes/10up-theme/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } } } } diff --git a/themes/10up-theme/includes/blocks.php b/themes/10up-theme/includes/blocks.php index a351d32..0816dbd 100644 --- a/themes/10up-theme/includes/blocks.php +++ b/themes/10up-theme/includes/blocks.php @@ -132,8 +132,8 @@ function enqueue_block_specific_styles() { wp_enqueue_block_style( $block_type, [ - 'handle' => "tenup-theme-{$block_namespace}-{$block_name}", - 'path' => $stylesheet_path, + 'handle' => "tenup-theme-{$block_namespace}-{$block_name}", + 'path' => $stylesheet_path, ] ); } diff --git a/themes/10up-theme/package.json b/themes/10up-theme/package.json index 8cdf8b6..d780515 100644 --- a/themes/10up-theme/package.json +++ b/themes/10up-theme/package.json @@ -16,7 +16,7 @@ "node": ">=18.0.0" }, "devDependencies": { - "10up-toolkit": "^6.3.0-next.0" + "10up-toolkit": "^6.3.0" }, "dependencies": { "modern-normalize": "^2.0.0"