Skip to content

Commit

Permalink
update modal width to 65vw
Browse files Browse the repository at this point in the history
  • Loading branch information
madhusudhand committed May 15, 2024
1 parent 424ebee commit b587221
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 9 deletions.
8 changes: 8 additions & 0 deletions admin/class-create-theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/editor-sidebar/json-editor-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const ThemeJsonEditorModal = ( { onRequestClose } ) => {
themeName
) }
onRequestClose={ onRequestClose }
className="create-block-theme__theme-json-modal"
>
<CodeMirror
extensions={ [ json() ] }
Expand Down
19 changes: 10 additions & 9 deletions src/editor-sidebar/metadata-editor-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export const ThemeMetadataEditorModal = ( { onRequestClose } ) => {
theme?.name
) }
onRequestClose={ onRequestClose }
className="create-block-theme__metadata-editor-modal"
>
<VStack>
<Text>
Expand Down Expand Up @@ -245,12 +246,7 @@ Plugin Description`,
<VStack alignment="left">
<img
src={ theme.screenshot }
style={ {
maxWidth: '200px',
height: 'auto',
aspectRatio: '4 / 3',
objectFit: 'cover',
} }
className="create-block-theme__metadata-editor-modal__screenshot"
alt=""
/>
<Button
Expand Down Expand Up @@ -293,9 +289,14 @@ Plugin Description`,
/>
</VStack>
<Spacer />
<Button variant="primary" onClick={ handleUpdateClick }>
{ __( 'Update', 'create-block-theme' ) }
</Button>
<HStack
justify={ 'flex-end' }
className="create-block-theme__metadata-editor-modal__footer"
>
<Button variant="primary" onClick={ handleUpdateClick }>
{ __( 'Update', 'create-block-theme' ) }
</Button>
</HStack>
</Modal>
);
};
1 change: 1 addition & 0 deletions src/plugin-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
30 changes: 30 additions & 0 deletions src/plugin-styles.scss
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit b587221

Please sign in to comment.