From b58722173f84e3825f74bc6b6fc6ed097287a280 Mon Sep 17 00:00:00 2001 From: madhusudhand Date: Wed, 15 May 2024 14:59:15 +0530 Subject: [PATCH] update modal width to 65vw --- admin/class-create-theme.php | 8 ++++++ src/editor-sidebar/json-editor-modal.js | 1 + src/editor-sidebar/metadata-editor-modal.js | 19 ++++++------- src/plugin-sidebar.js | 1 + src/plugin-styles.scss | 30 +++++++++++++++++++++ 5 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 src/plugin-styles.scss diff --git a/admin/class-create-theme.php b/admin/class-create-theme.php index 153d3f59..d1a469dc 100644 --- a/admin/class-create-theme.php +++ b/admin/class-create-theme.php @@ -50,8 +50,16 @@ function create_block_theme_enqueue() { $asset_file['dependencies'], $asset_file['version'] ); + wp_enqueue_style( + 'create-block-theme-styles', + plugins_url( 'build/plugin-sidebar.css', dirname( __FILE__ ) ), + false, + $asset_file['version'], + 'all' + ); wp_enqueue_script( 'create-block-theme-slot-fill', + 'create-block-theme-styles' ); // Enable localization in the plugin sidebar. diff --git a/src/editor-sidebar/json-editor-modal.js b/src/editor-sidebar/json-editor-modal.js index 3776fee5..afdba2bb 100644 --- a/src/editor-sidebar/json-editor-modal.js +++ b/src/editor-sidebar/json-editor-modal.js @@ -40,6 +40,7 @@ const ThemeJsonEditorModal = ( { onRequestClose } ) => { themeName ) } onRequestClose={ onRequestClose } + className="create-block-theme__theme-json-modal" > { theme?.name ) } onRequestClose={ onRequestClose } + className="create-block-theme__metadata-editor-modal" > @@ -245,12 +246,7 @@ Plugin Description`, + + + ); }; diff --git a/src/plugin-sidebar.js b/src/plugin-sidebar.js index 71ba269e..6dae1eed 100644 --- a/src/plugin-sidebar.js +++ b/src/plugin-sidebar.js @@ -53,6 +53,7 @@ import { ThemeMetadataEditorModal } from './editor-sidebar/metadata-editor-modal import ScreenHeader from './editor-sidebar/screen-header'; import { downloadExportedTheme } from './resolvers'; import { downloadFile } from './utils'; +import './plugin-styles.scss'; const CreateBlockThemePlugin = () => { const [ isEditorOpen, setIsEditorOpen ] = useState( false ); diff --git a/src/plugin-styles.scss b/src/plugin-styles.scss new file mode 100644 index 00000000..efd9bdb7 --- /dev/null +++ b/src/plugin-styles.scss @@ -0,0 +1,30 @@ +$plugin-prefix: "create-block-theme"; +$modal-footer-height: 70px; + +.#{$plugin-prefix} { + &__metadata-editor-modal { + width: 65vw !important; + padding-bottom: $modal-footer-height; + + &__footer { + border-top: 1px solid #ddd; + background-color: #fff; + position: absolute; + bottom: 0; + margin: 0 -32px; + padding: 16px 32px; + height: $modal-footer-height; + } + + &__screenshot { + max-width: 200px; + height: auto; + aspect-ratio: 4 / 3; + object-fit: cover; + } + } + + &__theme-json-modal { + width: 65vw !important; + } +}