From 1f5fdb9e5d237ca0de64a4b0866e9858a0ceb00b Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Sun, 24 Feb 2019 00:18:48 +0200 Subject: [PATCH] Use platform based SCSS vars for block minHeight --- packages/block-library/src/heading/edit.native.js | 7 ++++--- packages/block-library/src/heading/style.native.scss | 5 +++++ packages/block-library/src/paragraph/style.native.scss | 4 +++- packages/editor/src/components/post-title/index.native.js | 4 ++-- .../editor/src/components/post-title/style.native.scss | 4 ++++ 5 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 packages/block-library/src/heading/style.native.scss diff --git a/packages/block-library/src/heading/edit.native.js b/packages/block-library/src/heading/edit.native.js index d28021a0bbd99..dab8589b9c923 100644 --- a/packages/block-library/src/heading/edit.native.js +++ b/packages/block-library/src/heading/edit.native.js @@ -19,9 +19,7 @@ import { createBlock } from '@wordpress/blocks'; /** * Internal dependencies */ -import './editor.scss'; - -const minHeight = 24; +import styles from './style.scss'; class HeadingEdit extends Component { constructor( props ) { @@ -47,6 +45,9 @@ class HeadingEdit extends Component { } = attributes; const tagName = 'h' + level; + + const minHeight = styles.blockText.minHeight; + return ( diff --git a/packages/block-library/src/heading/style.native.scss b/packages/block-library/src/heading/style.native.scss new file mode 100644 index 0000000000000..d5018ce8e30b8 --- /dev/null +++ b/packages/block-library/src/heading/style.native.scss @@ -0,0 +1,5 @@ +@import "variables.scss"; + +.blockText { + min-height: $min-height-heading; +} diff --git a/packages/block-library/src/paragraph/style.native.scss b/packages/block-library/src/paragraph/style.native.scss index a732fa2608dd1..574c3f1d05934 100644 --- a/packages/block-library/src/paragraph/style.native.scss +++ b/packages/block-library/src/paragraph/style.native.scss @@ -1,3 +1,5 @@ +@import "variables.scss"; + .blockText { - min-height: 24; + min-height: $min-height-paragraph; } diff --git a/packages/editor/src/components/post-title/index.native.js b/packages/editor/src/components/post-title/index.native.js index 8204220b3be6d..4874628b42284 100644 --- a/packages/editor/src/components/post-title/index.native.js +++ b/packages/editor/src/components/post-title/index.native.js @@ -18,8 +18,6 @@ import { withInstanceId, compose } from '@wordpress/compose'; */ import styles from './style.scss'; -const minHeight = 30; - class PostTitle extends Component { constructor() { super( ...arguments ); @@ -72,6 +70,8 @@ class PostTitle extends Component { const decodedPlaceholder = decodeEntities( placeholder ); const borderColor = this.state.isSelected ? focusedBorderColor : 'transparent'; + const minHeight = styles.blockText.minHeight; + return (