Skip to content

Commit

Permalink
Merge pull request #289 from material-components/fix/fse-build
Browse files Browse the repository at this point in the history
Whitelist block.json in theme bundle
  • Loading branch information
emeaguiar committed Feb 1, 2022
2 parents 254475f + 7f21098 commit 434b7fe
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ module.exports = function ( grunt ) {
'!theme/assets/js/*.map',
'!theme/assets/js/editor*',
'!theme/assets/src/**',
'theme/assets/src/**/*.json',
'!theme/tests/**',
'!theme/wp-assets/**',
'!theme/composer*',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"description": "Material back to top button",
"editorStyle": [
"material-google-fonts-cdn",
"material-google-fonts",
"material-block-editor-css-theme"
],
"editorScript": "material-block-editor-js-theme"
Expand Down
2 changes: 1 addition & 1 deletion theme/assets/src/block-editor/blocks/card/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"supports": {},
"apiVersion": 2,
"description": "Material card for query loop block",
"editorStyle": ["material-google-fonts-cdn", "material-block-editor-css-theme"],
"editorStyle": ["material-google-fonts", "material-block-editor-css-theme"],
"editorScript": "material-block-editor-js-theme",
"usesContext": [ "postId", "postType", "queryId" ],
"textdomain": "material-design-google"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"title": "Dark Mode Switch",
"description": "Material dark mode switch",
"editorStyle": [
"material-google-fonts-cdn",
"material-google-fonts",
"material-block-editor-css-theme"
],
"editorScript": "material-block-editor-js-theme"
Expand Down
2 changes: 1 addition & 1 deletion theme/assets/src/block-editor/blocks/search/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"supports": {},
"description": "Material search bar",
"editorStyle": [
"material-google-fonts-cdn",
"material-google-fonts",
"material-block-editor-css-theme"
],
"editorScript": "material-block-editor-js-theme"
Expand Down
6 changes: 4 additions & 2 deletions theme/inc/block-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ function enqueue_block_editor_assets() {
$version,
false
);
if ( ! wp_style_is( 'material-google-fonts-cdn', 'enqueued' ) ) {

if ( ! wp_style_is( 'material-google-fonts', 'enqueued' ) ) {
// Ideally this should be injected by the plugin if not fallback to default fonts.
wp_enqueue_style(
'material-google-fonts-cdn',
'material-google-fonts',
esc_url( '//fonts.googleapis.com/css?family=Roboto|Material+Icons' ),
[],
$theme_version
Expand Down

0 comments on commit 434b7fe

Please sign in to comment.