diff --git a/web/app/themes/badegg/resources/js/blocks/lib/classNames.js b/web/app/themes/badegg/resources/js/blocks/lib/classNames.js index 70c1c79d..d150a854 100644 --- a/web/app/themes/badegg/resources/js/blocks/lib/classNames.js +++ b/web/app/themes/badegg/resources/js/blocks/lib/classNames.js @@ -5,7 +5,7 @@ export function containerClassNames(attributes, extraClasses = []) 'container', ]; - if('container_width' in attributes) + if('container_width' in attributes && !['', '0'].includes(attributes.container_width)) classNames.push(`container-${attributes.container_width}`); if('alignment' in attributes) diff --git a/web/app/themes/badegg/resources/views/blocks/article/editor.scss b/web/app/themes/badegg/resources/views/blocks/article/editor.scss index b1e1f47f..abbc8b48 100644 --- a/web/app/themes/badegg/resources/views/blocks/article/editor.scss +++ b/web/app/themes/badegg/resources/views/blocks/article/editor.scss @@ -1,8 +1,31 @@ @use "../../../css/global/variables/spacing"; .wp-block-badegg-article { + position: relative; + .wp-block-pullquote { padding: 0; margin: spacing.$innerLarge auto; } + + .badegg-article-select-parent { + appearance: none; + display: block; + position: absolute; + inset: 0; + background: transparent; + border: none; + } + + .block-editor-block-list { + &__layout { + > *:first-child { + margin-top: 0; + } + + > *:last-child { + margin-bottom: 0; + } + } + } } diff --git a/web/app/themes/badegg/resources/views/blocks/article/index.jsx b/web/app/themes/badegg/resources/views/blocks/article/index.jsx index 7088d746..3e5152b3 100644 --- a/web/app/themes/badegg/resources/views/blocks/article/index.jsx +++ b/web/app/themes/badegg/resources/views/blocks/article/index.jsx @@ -15,18 +15,28 @@ import BackgroundImage from '../../../js/blocks/components/BackgroundImage'; import BlockSettings from '../../../js/blocks/components/BlockSettings'; registerBlockType(metadata.name, { - edit({ attributes, setAttributes }) { + edit({ attributes, setAttributes, clientId }) { const blockProps = useBlockProps(); - blockProps.className = sectionClassNames(attributes, blockProps.className).join(' '); + + blockProps.className = containerClassNames(attributes, [ 'wysiwyg' ]).join(' '); return ( -