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

Button block markup in the front-end #1642

Closed
samikeijonen opened this issue Jul 2, 2017 · 1 comment
Closed

Button block markup in the front-end #1642

samikeijonen opened this issue Jul 2, 2017 · 1 comment
Labels
[Feature] Blocks Overall functionality of blocks [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Enhancement A suggestion for improvement.

Comments

@samikeijonen
Copy link
Contributor

Current button markup in the front-end:

<div class="aligncenter wp-block-button">
<a href="https://github.com/WordPress/gutenberg"><span>Help build Gutenberg</span></a>
</div>

I haven't check that closely but I was wondering why we need <div> wrapper? Could it just be p wrapper which feels more semantic markup.

First suggestion of markup without any testing:

<p class="aligncenter">
<a class="wp-block-button" href="https://github.com/WordPress/gutenberg"><span>Help build Gutenberg</span></a>
</p>

Note that I switched class="wp-block-button" to a element. I assume that many themes have already styles for link that look like a button. Now we just need to manually add that class to a element.

I'm not sure where the extra <span> is needed inside the <a>. Markup could be like this:

<p class="aligncenter">
<a class="wp-block-button" href="https://github.com/WordPress/gutenberg">Help build Gutenberg</a>
</p>

Or

<p class="aligncenter wp-block-button">
<a href="https://github.com/WordPress/gutenberg">Help build Gutenberg</a>
</p>
@mtias mtias added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Feature] Blocks Overall functionality of blocks [Type] Enhancement A suggestion for improvement. labels Aug 31, 2017
@karmatosed
Copy link
Member

Closing in favour of #2907

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants