Skip to content

Commit

Permalink
Make form files more specific to form page (#480)
Browse files Browse the repository at this point in the history
* Make form styles more specific

* Only load form files on CBT page
  • Loading branch information
mikachan authored Nov 23, 2023
1 parent cb5f020 commit 321e8ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions admin/create-theme/theme-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,12 @@ public static function create_admin_form_page() {
}

public static function form_script() {
wp_enqueue_script( 'form-script', plugin_dir_url( dirname( __FILE__ ) ) . 'js/form-script.js' );
wp_enqueue_style( 'form-style', plugin_dir_url( dirname( __FILE__ ) ) . 'css/form.css' );
if ( ! empty( $_GET['page'] ) && 'create-block-theme' === $_GET['page'] ) {
wp_enqueue_script( 'form-script', plugin_dir_url( dirname( __FILE__ ) ) . 'js/form-script.js' );
wp_enqueue_style( 'form-style', plugin_dir_url( dirname( __FILE__ ) ) . 'css/form.css' );

// Enable localization in the form.
wp_set_script_translations( 'form-script', 'create-block-theme' );
// Enable localization in the form.
wp_set_script_translations( 'form-script', 'create-block-theme' );
}
}
}
6 changes: 3 additions & 3 deletions admin/css/form.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
h2 {
.appearance_page_create-block-theme h2 {
margin-bottom: 0;
}

p.description {
.appearance_page_create-block-theme p.description {
margin-bottom: 1rem;
}

.submit {
.appearance_page_create-block-theme .submit {
clear: both;
}

Expand Down

0 comments on commit 321e8ab

Please sign in to comment.