thinkshout / thinkwp-starter-theme

Forked for ThinkShout from Timber: a dead-simple theme that you can build anything from
MIT License
1 stars 0 forks source link

Block: Text #21

Open JulesKhong opened 1 year ago

JulesKhong commented 1 year ago

Description

Adds base block

FE tasks

BE tasks

jamacon36 commented 1 year ago

@JulesKhong this feels like it repeats the Gutenberg Paragraph block: Image

feels like we should just lean on that and the other rich text blocks instead of nesting a wysiwyg in a custom block. Let me know what you think.

Update

Added a comment in Figma for context:

JulesKhong commented 1 year ago

@jamacon36 Can we limit the ability for the editor to add an h1 using a text block? It'll mess up SEO and accessibility since the banner will already have one

JulesKhong commented 1 year ago

@jamacon36 To define spacing, it's actually easier to remove the block wrappers, and keeps it from breaking ul and ol tags. I took this out of class-theme.php, but we can bring this back if you prefer it.

if ( preg_match( '~^core/|core-embed/~', $block['blockName'] ) ) {
            // Remove slashes from block name.
            $block_name = str_replace( '/', '-', $block['blockName'] );
            $block_content = sprintf( '<div class="ts-block ts-block--'. $block_name .'">%s</div>', $block_content );