Skip to content

Commit

Permalink
Add the preview iframe fix (#52)
Browse files Browse the repository at this point in the history
* Add the preview iframe fix

* Add the wp-activate handles

Co-authored-by: Christopher Kanitz <ckanitz@users.noreply.github.com>
  • Loading branch information
Luehrsen and ckanitz authored Jan 3, 2023
1 parent 478c9bf commit af0febb
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 2 deletions.
31 changes: 29 additions & 2 deletions schemas/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,8 @@
"auto",
"block",
"fallback",
"swap"
"swap",
"optional"
]
},
"src": {
Expand Down Expand Up @@ -1237,7 +1238,33 @@
"type": "object",
"properties": {
"button": {
"$ref": "#/definitions/stylesPropertiesComplete"
"type": "object",
"allOf": [
{
"$ref": "#/definitions/stylesProperties"
},
{
"properties": {
"border": {},
"color": {},
"filter": {},
"outline": {},
"shadow": {},
"spacing": {},
"typography": {},
":hover": {
"$ref": "#/definitions/stylesPropertiesComplete"
},
":focus": {
"$ref": "#/definitions/stylesPropertiesComplete"
},
":active": {
"$ref": "#/definitions/stylesPropertiesComplete"
}
},
"additionalProperties": false
}
]
},
"link": {
"type": "object",
Expand Down
20 changes: 20 additions & 0 deletions theme/footer-wp-activate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* The footer for the multisite user activation page.
*
* This is the template that displays all of the <footer> section. This file exists to
* be as barebones as possible, because during multisite user activation, the theme
* is loaded without any plugins. This means that the theme cannot use any functions
* from plugins.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package lhpbpt
*/

namespace WpMunich\lhpbpt;

wp_footer(); ?>

</body>
</html>
27 changes: 27 additions & 0 deletions theme/header-wp-activate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* The header for the multisite user activation page.
*
* This is the template that displays all of the <head> section. This file exists to
* be as barebones as possible, because during multisite user activation, the theme
* is loaded without any plugins. This means that the theme cannot use any functions
* from plugins.
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package lhpbpt
*/

namespace WpMunich\lhpbpt;

?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">

<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
10 changes: 10 additions & 0 deletions theme/src/css/vars.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,13 @@
@import "vars/_typography.css";
@import "vars/_colors.css";
@import "vars/_content-width.css";

/**
* Hack to make sure this file is actually loaded in the
* block-editor-block-preview__content-iframe
*
* @see https://github.com/WordPress/gutenberg/blob/88dc79e4219170be3d86dff5823e6baef23f7331/packages/block-editor/src/components/iframe/index.js#L41
*/
.wp-block-foobar {
--foo: bar;
}

0 comments on commit af0febb

Please sign in to comment.