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

Add button class to button output for styling #1354

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blocks/library/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ registerBlockType( 'core/button', {
const { url, text, title, align = 'none' } = attributes;

return (
<div className={ `align${ align }` }>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest blocks-button instead to avoid ambiguity with already defined button classes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should take a step back and figure out a consistent way for naming these classes across all blocks. Not sure blocks-{name} will be enough. Maybe we should use the namespace of the block wp-core-button? This is something we want to get right and not change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All blocks have a unique attribute like: div[data-type="core/preformatted"].

<div className={ `blocks-button align${ align }` }>
<a href={ url } title={ title }>
{ text }
</a>
Expand Down