From 2c63cdc4b4d7981489000691f48bf7cff080a8f0 Mon Sep 17 00:00:00 2001 From: Madhu Dollu Date: Thu, 30 May 2024 16:34:42 +0530 Subject: [PATCH] Update modal width to 65vw (#638) * update modal width to 65vw * set the modal size to large * update wp_enqueue_style arguments Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> --------- Co-authored-by: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Co-authored-by: Jason Crist Co-authored-by: Matias Benedetto --- .../class-create-block-theme-editor-tools.php | 6 +++++ src/editor-sidebar/json-editor-modal.js | 3 ++- src/editor-sidebar/metadata-editor-modal.js | 21 ++++++++-------- src/plugin-sidebar.js | 1 + src/plugin-styles.scss | 25 +++++++++++++++++++ 5 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 src/plugin-styles.scss diff --git a/includes/class-create-block-theme-editor-tools.php b/includes/class-create-block-theme-editor-tools.php index 6f8efef2..4a940cda 100644 --- a/includes/class-create-block-theme-editor-tools.php +++ b/includes/class-create-block-theme-editor-tools.php @@ -28,6 +28,12 @@ function create_block_theme_sidebar_enqueue() { $asset_file['dependencies'], $asset_file['version'] ); + wp_enqueue_style( + 'create-block-theme-styles', + plugins_url( 'build/plugin-sidebar.css', dirname( __FILE__ ) ), + array(), + $asset_file['version'] + ); wp_enqueue_script( 'create-block-theme-slot-fill', ); diff --git a/src/editor-sidebar/json-editor-modal.js b/src/editor-sidebar/json-editor-modal.js index 3776fee5..11d367ca 100644 --- a/src/editor-sidebar/json-editor-modal.js +++ b/src/editor-sidebar/json-editor-modal.js @@ -33,13 +33,14 @@ const ThemeJsonEditorModal = ( { onRequestClose } ) => { return ( { return ( @@ -305,12 +306,7 @@ ${ __( 'Source', 'create-block-theme' ) }` } + + + ); }; diff --git a/src/plugin-sidebar.js b/src/plugin-sidebar.js index 2a08ca59..9d30ec5d 100644 --- a/src/plugin-sidebar.js +++ b/src/plugin-sidebar.js @@ -49,6 +49,7 @@ import { ThemeMetadataEditorModal } from './editor-sidebar/metadata-editor-modal import ScreenHeader from './editor-sidebar/screen-header'; import { downloadExportedTheme } from './resolvers'; import downloadFile from './utils/download-file'; +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..4af13616 --- /dev/null +++ b/src/plugin-styles.scss @@ -0,0 +1,25 @@ +$plugin-prefix: "create-block-theme"; +$modal-footer-height: 70px; + +.#{$plugin-prefix} { + &__metadata-editor-modal { + 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; + } + } +}