Skip to content

Commit

Permalink
Duplicated styles from Gutenberg repo for button, to maintain style c…
Browse files Browse the repository at this point in the history
…onsistency with Core Button block without relying on a class from that block (wp-block-button__link).
  • Loading branch information
jeffersonrabb committed Feb 11, 2019
1 parent bc6db32 commit 8f066fd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/gutenberg/extensions/mailchimp/edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class MailchimpSubscribeEdit extends Component {
{ ! audition && (
<form ref={ this.formRef }>
<TextControl placeholder={ emailPlaceholder } onChange={ () => false } type="email" />
<div className="wp-block-button__link wp-block-jetpack-mailchimp_button">
<div className="wp-block-jetpack-mailchimp_button">
<RichText
formattingControls={ [] }
placeholder={ __( 'Add button text…' ) }
Expand Down
19 changes: 19 additions & 0 deletions client/gutenberg/extensions/mailchimp/editor.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
@import './view.scss';

// Variables from the https://github.com/WordPress/gutenberg to maintain style consistency with core Button block
$big-font-size: 18px;
$blocks-button__height: 46px;
$blocks-button__line-height: $big-font-size + 6px;

.wp-block-jetpack-mailchimp {

.wp-block-jetpack-mailchimp_notification {
Expand All @@ -13,6 +18,20 @@
font-family: $sans;
font-weight: bold;
margin-bottom: 1.5em;

// Styles from the Gutenberg repo to maintain style consistency with core Button block
border: none;
box-shadow: none;
cursor: pointer;
display: inline-block;
font-size: $big-font-size;
line-height: $blocks-button__line-height;
margin: 0;
padding: ($blocks-button__height - $blocks-button__line-height) / 2 24px;
text-align: center;
text-decoration: none;
white-space: normal;
word-break: break-all;
}

}

0 comments on commit 8f066fd

Please sign in to comment.