Skip to content

Commit

Permalink
Add classic theme styles as a static file not in a package
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Oct 19, 2022
1 parent a97b38a commit 20fed67
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions src/wp-includes/css/classic-themes.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* These rules are needed for backwards compatibility.
* They should match the button element rules in the base theme.json file.
*/
.wp-block-button__link {
color: #ffffff;
background-color: #32373c;
border-radius: 9999px; /* 100% causes an oval, but any explicit but really high value retains the pill shape. */

/* This needs a low specificity so it won't override the rules from the button element if defined in theme.json. */
box-shadow: none;
text-decoration: none;

/* The extra 2px are added to size solids the same as the outline versions.*/
padding: calc(0.667em + 2px) calc(1.333em + 2px);

font-size: 1.125em;
}
4 changes: 2 additions & 2 deletions src/wp-includes/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -3667,7 +3667,7 @@ function _wp_theme_json_webfonts_handler() {
function wp_enqueue_classic_theme_styles() {
if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) {
$suffix = wp_scripts_get_suffix();
wp_register_style( 'classic-theme-styles', "/wp-includes/css/dist/block-library/classic$suffix.css", array(), true );
wp_register_style( 'classic-theme-styles', '/' . WPINC . "/css/classic-themes$suffix.css", array(), true );
wp_enqueue_style( 'classic-theme-styles' );
}
}
Expand All @@ -3687,7 +3687,7 @@ function wp_add_editor_classic_theme_styles( $editor_settings ) {
return $editor_settings;
}
$suffix = wp_scripts_get_suffix();
$classic_theme_styles = __DIR__ . "/css/dist/block-library/classic$suffix.css";
$classic_theme_styles = ABSPATH . WPINC . "/css/classic-themes$suffix.css";

// This follows the pattern of get_block_editor_theme_styles,
// but we can't use get_block_editor_theme_styles directly as it
Expand Down

0 comments on commit 20fed67

Please sign in to comment.