Skip to content
Closed
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
9 changes: 6 additions & 3 deletions client/gutenberg/extensions/todo/block.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/** @format */

/* eslint wpcalypso/jsx-classname-namespace: 0 */

/**
* External dependencies
*/
Expand Down Expand Up @@ -154,9 +156,10 @@ const edit = class extends Component {

render() {
const { items, newItemAt } = this.state;
const { className } = this.props;
return (
<div className="wp-editor-a8c-todo">
<ul className="wp-editor-a8c-todo-list">
<div className={ className }>
<ul className={ `${ className }-list` }>
{ items.map( ( item, itemIndex ) => {
const moveUp = () => {
this.moveUp( itemIndex );
Expand Down Expand Up @@ -206,7 +209,7 @@ const edit = class extends Component {
);
} ) }
</ul>
<div class="add-new-todo-item-form">
<div className="add-new-todo-item-form">
<Button onClick={ this.addNewItem }>
<Dashicon icon="plus" /> Add new item
</Button>
Expand Down
50 changes: 14 additions & 36 deletions client/gutenberg/extensions/todo/editor.scss
Original file line number Diff line number Diff line change
@@ -1,29 +1,10 @@
// Hugo's new WordPress shades of gray
// from http://codepen.io/hugobaeta/pen/grJjVp
$black: #000;
$dark-gray-900: #191e23;
$dark-gray-800: #23282d;
$dark-gray-700: #32373c;
$dark-gray-600: #40464d;
$dark-gray-500: #555d66; // use this most of the time for dark items
$dark-gray-400: #606a73;
$dark-gray-300: #6c7781;
$dark-gray-200: #7e8993;
$dark-gray-100: #8f98a1;
$light-gray-900: #a2aab2;
$light-gray-800: #b5bcc2;
$light-gray-700: #ccd0d4;
$light-gray-600: #d7dade;
$light-gray-500: #e2e4e7; // good for "grayed" items and borders
$light-gray-400: #e8eaeb;
$light-gray-300: #edeff0;
$light-gray-200: #f3f4f5;
$light-gray-100: #f8f9f9;
$white: #fff;

$color-accent-green: #31843f;

.wp-editor-a8c-todo {
// Calypso colors
@import '../../../../assets/stylesheets/shared/_colors.scss';

// Gutenberg colors
@import '../../editor/edit-post/assets/stylesheets/_colors.scss';

.wp-block-a8c-todo {
margin-bottom: 20px;

// This would be ideal but it's being overridden.
Expand Down Expand Up @@ -58,10 +39,10 @@ $color-accent-green: #31843f;

// Completed checklist item.
.item-done {
color: $color-accent-green;
color: $green-text-min;

.item-status {
background: $color-accent-green;
background: $green-text-min;
border: 0;
position: relative;
}
Expand Down Expand Up @@ -124,40 +105,37 @@ $color-accent-green: #31843f;
display: inline;
}
}

}


}

// We need to be super-specific here to be sure we're overwriting the default UL styling.
.edit-post-visual-editor .wp-editor-a8c-todo .wp-editor-a8c-todo-list {
.edit-post-visual-editor .wp-block-a8c-todo .wp-block-a8c-todo-list {
list-style-type: none;
}

// Same for the "add item" input.
.editor-block-list__block .wp-editor-a8c-todo .add-new-item {
.editor-block-list__block .wp-block-a8c-todo .add-new-item {
width: 100%;
margin-right: 6px;
padding: 7.5px 8px;
}

// P2-specific styling.
body:not( .wp-admin ) .gutenberg {
.wp-editor-a8c-todo .todolist-item {
.wp-block-a8c-todo .todolist-item {
padding: 10px 0 4px;
}
}


// Only show the "add new" form when it's strictly needed.
.wp-editor-a8c-todo .add-new-todo-item-form {
.wp-block-a8c-todo .add-new-todo-item-form {
display: none;
}

.editor-block-list__block.is-selected,
.editor-block-list__block.is-typing {
.wp-editor-a8c-todo .add-new-todo-item-form {
.wp-block-a8c-todo .add-new-todo-item-form {
display: flex;
}
}