From 7fa1a984ee1911b3de7737419ade6690cd7375dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Fri, 10 Aug 2018 11:16:34 +0200 Subject: [PATCH] HACK: PoC to improve the draggable indicator This tweaks the dashicon viewBox to render a not too embarrasing draggable indicator. This needs fixing. --- packages/components/src/dashicon/index.js | 5 +++-- packages/editor/src/components/block-list/breadcrumb.js | 4 ++-- packages/editor/src/components/block-list/style.scss | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/components/src/dashicon/index.js b/packages/components/src/dashicon/index.js index c103795736e638..4541f1dc56ecfd 100644 --- a/packages/components/src/dashicon/index.js +++ b/packages/components/src/dashicon/index.js @@ -15,12 +15,13 @@ export default class Dashicon extends Component { return ( this.props.icon !== nextProps.icon || this.props.size !== nextProps.size || + this.props.viewBox !== nextProps.viewBox || this.props.className !== nextProps.className ); } render() { - const { icon, className, size = 20 } = this.props; + const { icon, className, size = 20, viewBox = 20 } = this.props; let path; switch ( icon ) { @@ -893,7 +894,7 @@ export default class Dashicon extends Component { xmlns="http://www.w3.org/2000/svg" width={ size } height={ size } - viewBox="0 0 20 20" + viewBox={ '0 0 ' + viewBox + ' ' + viewBox } // TODO: if we like this approach, remove this hack and implement upstream > diff --git a/packages/editor/src/components/block-list/breadcrumb.js b/packages/editor/src/components/block-list/breadcrumb.js index 38bab6d23b5793..71b5798c8629e5 100644 --- a/packages/editor/src/components/block-list/breadcrumb.js +++ b/packages/editor/src/components/block-list/breadcrumb.js @@ -2,7 +2,7 @@ * WordPress dependencies */ import { Component, Fragment } from '@wordpress/element'; -import { Toolbar } from '@wordpress/components'; +import { Dashicon, Toolbar } from '@wordpress/components'; import { withSelect } from '@wordpress/data'; import { compose } from '@wordpress/compose'; @@ -53,7 +53,7 @@ export class BlockBreadcrumb extends Component { return (
-
:::  
+
{ rootClientId && ( diff --git a/packages/editor/src/components/block-list/style.scss b/packages/editor/src/components/block-list/style.scss index a305525cc51b59..441572546fab07 100644 --- a/packages/editor/src/components/block-list/style.scss +++ b/packages/editor/src/components/block-list/style.scss @@ -944,6 +944,10 @@ .editor-block-list__block:hover & { @include fade_in(0.1s); } + + .editor-block-list__breadcrumb-drag-handle { + margin-right: 2px; + } } }