Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block markup #12

Open
webmandesign opened this issue Nov 6, 2024 · 1 comment
Open

Block markup #12

webmandesign opened this issue Nov 6, 2024 · 1 comment

Comments

@webmandesign
Copy link

I'm trying to add this block into my theme's template parts and noticed it outputs a full HTML markup in editor, such as:

<!-- wp:tabor/dark-mode-toggle {"style":{"border":{"width":"2px"},"elements":{"link":{"color":{"text":"var:preset|color|contrast-alt"}}}},"backgroundColor":"base","textColor":"contrast-alt","borderColor":"contrast-alt"} -->
<div class="wp-block-tabor-dark-mode-toggle is-small">...</div>
<!-- /wp:tabor/dark-mode-toggle -->

From my experience this is prone to future errors once a plugin is updated, for example, or WordPress core changes something regarding block markup.

Would it be possible to make the plugin output a simple inline HTML comment markup (such as is the case with core/site-logo block with its <!-- wp:site-logo /--> markup), something like:

<!-- wp:tabor/dark-mode-toggle {"style":{"border":{"width":"2px"},"elements":{"link":{"color":{"text":"var:preset|color|contrast-alt"}}}},"backgroundColor":"base","textColor":"contrast-alt","borderColor":"contrast-alt"} /-->

Thank's for consideration!

@richtabor
Copy link
Owner

Yea, it's a trade-off either way. It's currently not a dynamic block. I'll think about it more, but I'm trying to recall why I did not go that route.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants