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

Polish the button #3427

Merged
merged 3 commits into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
25 changes: 25 additions & 0 deletions blocks/editable/format-toolbar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,31 @@
}
}

.blocks-format-toolbar__inline-link-modal {
background: #fff;
width: 305px;
display: flex;
margin-left: auto;
margin-right: auto;
flex-wrap: wrap;
align-items: center;
font-family: $default-font;
font-size: $default-font-size;
line-height: $default-line-height;

.blocks-url-input {
width: auto;
}

.dashicon {
color: $dark-gray-100;
}

.blocks-url-input input[type=text]::placeholder {
color: $dark-gray-100;
}
}

.blocks-format-toolbar__link-value {
padding: 10px;
flex-grow: 1;
Expand Down
25 changes: 13 additions & 12 deletions blocks/library/button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { IconButton, PanelBody } from '@wordpress/components';
import { Dashicon, IconButton, PanelBody } from '@wordpress/components';

/**
* Internal dependencies
Expand Down Expand Up @@ -93,17 +93,6 @@ registerBlockType( 'core/button', {
} }
keepPlaceholderOnFocus
/>
{ focus &&
<form
className="blocks-format-toolbar__link-modal"
onSubmit={ ( event ) => event.preventDefault() }>
<UrlInput
value={ url }
onChange={ ( value ) => setAttributes( { url: value } ) }
/>
<IconButton icon="editor-break" label={ __( 'Apply' ) } type="submit" />
</form>
}
{ focus &&
<InspectorControls key="inspector">
<BlockDescription>
Expand All @@ -130,6 +119,18 @@ registerBlockType( 'core/button', {
</InspectorControls>
}
</span>,
focus && (
<form
className="blocks-format-toolbar__inline-link-modal"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we do not want to share the style of this class with other blocks, it may make sense to rename the classname to match our guidelines. Something like blocks-button__inline-link. Ans style it as part of the editor.scss of the button block

onSubmit={ ( event ) => event.preventDefault() }>
<Dashicon icon="admin-links" />
<UrlInput
value={ url }
onChange={ ( value ) => setAttributes( { url: value } ) }
/>
<IconButton icon="editor-break" label={ __( 'Apply' ) } type="submit" />
</form>
)
Copy link
Contributor

@youknowriad youknowriad Nov 10, 2017

Choose a reason for hiding this comment

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

@jasmussen Yep, travis is failing because of a missing trailing comma after this parenthesis. You should definitely install an eslint plugin to your favorite IDE ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

💓💓👍🌌

Copy link
Contributor

Choose a reason for hiding this comment

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

Have a nice weekend Joen :)

];
},

Expand Down
13 changes: 5 additions & 8 deletions blocks/library/button/style.scss
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
$blocks-button__height: 46px;

.wp-block-button {
font-family: $default-font;
display: inline-block;
text-decoration: none;
font-size: $big-font-size;
margin: 0;
padding: 0 24px;
height: $blocks-button__height;
line-height: $blocks-button__height;
cursor: default;
border-radius: $blocks-button__height / 2;
white-space: nowrap;
background: $blue-medium-400;
color: $white;
background: currentColor;
vertical-align: top;
position: relative;

> div {
color: $white;
}

a {
box-shadow: none !important;
color: $white;
cursor: pointer;
text-decoration: none !important;
}

&:hover {
color: $white;
}

&.aligncenter {
display: inline-block;
}
Expand Down