mirror of
https://github.com/WordPress/create-block-theme.git
synced 2025-10-03 16:11:13 +08:00
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 <jcrist@pbking.com> Co-authored-by: Matias Benedetto <matias.benedetto@gmail.com>
This commit is contained in:
parent
485f8937de
commit
2c63cdc4b4
5 changed files with 45 additions and 11 deletions
|
@ -28,6 +28,12 @@ class CBT_Editor_Tools {
|
|||
$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',
|
||||
);
|
||||
|
|
|
@ -33,13 +33,14 @@ const ThemeJsonEditorModal = ( { onRequestClose } ) => {
|
|||
|
||||
return (
|
||||
<Modal
|
||||
isFullScreen
|
||||
size="large"
|
||||
title={ sprintf(
|
||||
// translators: %s: theme name.
|
||||
__( 'theme.json for %s', 'create-block-theme' ),
|
||||
themeName
|
||||
) }
|
||||
onRequestClose={ onRequestClose }
|
||||
className="create-block-theme__theme-json-modal"
|
||||
>
|
||||
<CodeMirror
|
||||
extensions={ [ json() ] }
|
||||
|
|
|
@ -133,13 +133,14 @@ export const ThemeMetadataEditorModal = ( { onRequestClose } ) => {
|
|||
|
||||
return (
|
||||
<Modal
|
||||
isFullScreen
|
||||
size="large"
|
||||
title={ sprintf(
|
||||
// translators: %s: theme name.
|
||||
__( 'Metadata for %s', 'create-block-theme' ),
|
||||
theme?.name
|
||||
) }
|
||||
onRequestClose={ onRequestClose }
|
||||
className="create-block-theme__metadata-editor-modal"
|
||||
>
|
||||
<VStack>
|
||||
<Text>
|
||||
|
@ -305,12 +306,7 @@ ${ __( 'Source', 'create-block-theme' ) }` }
|
|||
<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
|
||||
|
@ -353,9 +349,14 @@ ${ __( 'Source', 'create-block-theme' ) }` }
|
|||
/>
|
||||
</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>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -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 );
|
||||
|
|
25
src/plugin-styles.scss
Normal file
25
src/plugin-styles.scss
Normal file
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue