├── src ├── editor.scss ├── style.scss ├── index.js └── blocks │ └── container │ ├── style.scss │ ├── editor.scss │ └── index.js ├── .gitignore ├── package.json ├── plugin.php └── webpack.config.js /src/editor.scss: -------------------------------------------------------------------------------- 1 | @import "./blocks/container/editor.scss"; 2 | -------------------------------------------------------------------------------- /src/style.scss: -------------------------------------------------------------------------------- 1 | @import "./blocks/container/style.scss"; 2 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Internal dependencies 3 | */ 4 | 5 | import './blocks/container'; 6 | -------------------------------------------------------------------------------- /src/blocks/container/style.scss: -------------------------------------------------------------------------------- 1 | .entry-content { 2 | 3 | .wp-block-custom-block-container { 4 | padding: 30px 50px; 5 | box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/*.min.js 2 | **/*.build.js 3 | **/*.build.css 4 | **/node_modules/** 5 | **/build/** 6 | build 7 | coverage 8 | cypress 9 | node_modules 10 | *.sublime-project 11 | *.sublime-workspace 12 | .DS_Store 13 | *.cache 14 | 15 | -------------------------------------------------------------------------------- /src/blocks/container/editor.scss: -------------------------------------------------------------------------------- 1 | .wp-block[data-type="custom-block/container"] { 2 | 3 | > .block-editor-block-list__block-edit { 4 | padding: 30px 50px; 5 | box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/blocks/container/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * WordPress dependencies 3 | */ 4 | const { __ } = wp.i18n; 5 | const { registerBlockType } = wp.blocks; 6 | const { InnerBlocks } = wp.blockEditor; 7 | 8 | registerBlockType( 'custom-block/container', { 9 | title: __( 'Custom Container' ), 10 | 11 | description: __( 'Provide custom container.' ), 12 | 13 | keywords: [ 14 | __( 'container' ), 15 | __( 'wrapper' ), 16 | __( 'section' ), 17 | ], 18 | 19 | supports: { 20 | align: [ 'wide', 'full' ], 21 | anchor: true, 22 | html: false, 23 | }, 24 | 25 | category: 'common', 26 | 27 | icon: 'editor-kitchensink', 28 | 29 | attributes: { 30 | content: { 31 | type: 'string', 32 | }, 33 | }, 34 | 35 | edit: ( props ) => { 36 | const { className } = props; 37 | 38 | return ( 39 |