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 placeholders, inserter, responsiveness #1439

Merged
merged 6 commits into from
Jun 27, 2017
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions editor/assets/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ body.gutenberg_page_gutenberg-demo {
padding: 6px 10px;

&::-webkit-input-placeholder {
color: $dark-gray-100;
color: $dark-gray-300;
}
&::-moz-placeholder {
color: $dark-gray-100;
color: $dark-gray-300;
}
&:-ms-input-placeholder {
color: $dark-gray-100;
color: $dark-gray-300;
}
&:-moz-placeholder {
color: $dark-gray-100;
color: $dark-gray-300;
}
}
}
7 changes: 7 additions & 0 deletions editor/block-mover/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
top: 10px;
left: 0;
padding: 0 14px 20px 0; // handles hover area

// Mobile, to be revisited
display: none;

@include break-small {
display: block;
}
}

.editor-block-mover__control {
Expand Down
7 changes: 7 additions & 0 deletions editor/block-settings-menu/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
position: absolute;
top: 10px;
right: 0;

// Mobile, to be revisited
display: none;

@include break-small {
display: block;
}
}

.editor-block-settings-menu__control {
Expand Down
2 changes: 1 addition & 1 deletion editor/modes/visual-editor/block-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class VisualEditorBlockList extends Component {
type="text"
readOnly
className="editor-visual-editor__placeholder"
value={ ! blocks.length ? __( 'Write your story.' ) : __( 'Continue writing…' ) }
value={ ! blocks.length ? __( 'Write your story' ) : __( 'Continue writing…' ) }
onFocus={ ! blocks.length ? this.appendDefaultBlock : noop }
onClick={ !! blocks.length ? this.appendDefaultBlock : noop }
onKeyDown={ !! blocks.length ? this.onPlaceholderKeyDown : noop }
Expand Down
50 changes: 39 additions & 11 deletions editor/modes/visual-editor/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,30 @@
margin-bottom: 5px;
max-width: $visual-editor-max-width + ( 2 * $block-mover-padding-visible );
position: relative;
// The block mover needs to stay inside the block to allow clicks when hovering the block
padding: $block-padding $block-padding + $block-mover-padding-visible;

padding: $block-padding;

@include break-small {
// The block mover needs to stay inside the block to allow clicks when hovering the block
padding: $block-padding $block-padding + $block-mover-padding-visible;
}

&:before {
z-index: z-index( '.editor-visual-editor__block:before' );
content: '';
position: absolute;
top: 0;
bottom: 0;
left: $block-mover-padding-visible;
right: $block-mover-padding-visible;
outline: 1px solid transparent;
transition: 0.2s outline;
top: 0;
bottom: 0;

left: 0;
right: 0;

@include break-small {
left: $block-mover-padding-visible;
right: $block-mover-padding-visible;
}
}

&.is-hovered:before {
Expand Down Expand Up @@ -211,14 +222,17 @@
z-index: z-index( '.editor-visual-editor__block-controls' );
margin-top: -$block-controls-height - $item-spacing;
margin-bottom: $item-spacing + 20px; // 20px is the offset from the bottom of the selected block where it stops sticking
height: $block-controls-height;
width: 0;
white-space: nowrap;

top: $header-height + $item-spacing;
// Mobile viewport
top: $header-height - 1px;
margin-left: -$block-padding;
margin-right: -$block-padding;

// Larger viewports
@include break-small() {
top: $header-height + $admin-bar-height-big + $item-spacing;
margin-left: 0;
}

@include break-medium() {
Expand All @@ -240,6 +254,7 @@ $sticky-bottom-offset: 20px;
.editor-visual-editor__block-controls .components-toolbar {
margin-right: -1px;

// Larger viewports
@include break-small() {
margin-right: $item-spacing;
}
Expand All @@ -250,7 +265,20 @@ $sticky-bottom-offset: 20px;
}

.editor-visual-editor .editor-inserter {
margin: $item-spacing $item-spacing $item-spacing calc( 50% - #{ $visual-editor-max-width / 2 } ); // account for full-width trick
margin: $item-spacing;

@include break-small {
margin: $item-spacing $item-spacing $item-spacing calc( 50% - #{ $visual-editor-max-width / 2 } ); // account for full-width trick
}

.editor-inserter__toggle {
color: $dark-gray-300;
margin: 4px 0 0 4px; // align better with text blocks
}

.editor-inserter__toggle.components-icon-button:not(:disabled):hover {
color: $blue-medium-500;
}
}

.editor-visual-editor .editor-visual-editor__insertion-point {
Expand Down Expand Up @@ -283,7 +311,7 @@ $sticky-bottom-offset: 20px;
transition: 0.2s outline;
text-align: left;
width: 100%;
color: $light-gray-700;
color: $dark-gray-300;
font-size: $editor-font-size;
line-height: $editor-line-height;
cursor: text;
Expand Down
2 changes: 1 addition & 1 deletion editor/post-title/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class PostTitle extends Component {
className="editor-post-title__input"
value={ title }
onChange={ this.onChange }
placeholder={ __( 'Add title' ) }
placeholder={ __( 'Add title' ) }
onFocus={ this.onSelect }
onClick={ this.onSelect }
onKeyDown={ this.onKeyDown }
Expand Down
6 changes: 5 additions & 1 deletion editor/post-title/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
.editor-post-title {
margin-left: auto;
margin-right: auto;
max-width: $visual-editor-max-width;
position: relative;
margin-bottom: 10px;
max-width: $visual-editor-max-width - ( 2 * $block-mover-margin );

@include break-small {
max-width: $visual-editor-max-width;
}

h1 {
outline: 1px solid transparent;
Expand Down