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

Block Switcher: Add 'Transform into:' to top of the list #2846

Merged
merged 3 commits into from
Oct 3, 2017

Conversation

christophherr
Copy link
Contributor

@christophherr christophherr commented Oct 2, 2017

Description

Adds the text "Transform into" wrapped in span tags to the top of the list in the Block Switcher.
Related issue: #493

How Has This Been Tested?

Visually on my local machine.

Screenshots (jpeg or gifs if applicable):

Before: https://cloudup.com/cPWwpVWU7b5
After: https://cloudup.com/cOKNmDJeu_8

Types of changes

It's labelled as an enhancement.

Checklist:

  • [ x] My code is tested.
  • [ x] My code follows the WordPress code style.
  • My code follows has proper inline documentation.

@youknowriad youknowriad added the Needs Design Feedback Needs general design feedback. label Oct 2, 2017
@youknowriad youknowriad requested a review from jasmussen October 2, 2017 08:54
- Add padding
- Add color
- Rephrase to remove the s
@jasmussen
Copy link
Contributor

Nice! Thank you for working on this.

I took the liberty of pushing a little fix to the visual styles:

screen shot 2017-10-02 at 11 09 29

What do you think? If you're cool with the changes then 👍 👍 from me.

@@ -90,6 +90,7 @@ class BlockSwitcher extends Component {
tabIndex="0"
aria-label={ __( 'Block types' ) }
>
<span>{ __( 'Transform into:' ) }</span>
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use a classname to avoid targeting elements in styling? something like editor-block-switcher__menu-title

@@ -34,6 +34,12 @@
input {
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated but this style is probably useless, I can't see any input inside the block switcher menu

@christophherr
Copy link
Contributor Author

Thanks for reviewing and improving.
The color contrast with $light-gray-900 seems pretty low.
What is the minimum contrast ratio we need?

@jasmussen
Copy link
Contributor

The color contrast with $light-gray-900 seems pretty low.

I personally feel like for this particular help text it's okay that it's lower than usual.

However I also would never object to increasing the contrast.

You can see the color variables here: https://github.com/WordPress/gutenberg/blob/master/editor/assets/stylesheets/_variables.scss and use this contrast checker: https://www.joedolson.com/tools/color-contrast.php

In my test it seems like $dark-gray-300 is the lightest one that passes.

If you address Riads feedback, I think this PR is good to merge 👍 👍

Thanks again!

@christophherr
Copy link
Contributor Author

Thanks for your help!
I addressed the feedback from both of you.

@codecov
Copy link

codecov bot commented Oct 3, 2017

Codecov Report

Merging #2846 into master will increase coverage by 0.15%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2846      +/-   ##
=========================================
+ Coverage   33.74%   33.9%   +0.15%     
=========================================
  Files         191     191              
  Lines        5695    5699       +4     
  Branches      997     999       +2     
=========================================
+ Hits         1922    1932      +10     
+ Misses       3192    3187       -5     
+ Partials      581     580       -1
Impacted Files Coverage Δ
editor/block-switcher/index.js 0% <ø> (ø) ⬆️
blocks/library/more/index.js 22.22% <0%> (-7.78%) ⬇️
editor/modes/visual-editor/block-list.js 0% <0%> (ø) ⬆️
blocks/library/paragraph/index.js 33.33% <0%> (ø) ⬆️
...ditor/sidebar/block-inspector/advanced-controls.js 0% <0%> (ø) ⬆️
blocks/api/serializer.js 98% <0%> (+0.08%) ⬆️
editor/reducer.js 88.96% <0%> (+0.39%) ⬆️
blocks/library/cover-image/index.js 33.33% <0%> (+2.89%) ⬆️
blocks/api/paste/index.js 86.66% <0%> (+7.35%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a596ceb...0e78f8f. Read the comment docs.

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

Nice! thank you

@youknowriad youknowriad merged commit 6dc6c78 into WordPress:master Oct 3, 2017
@christophherr christophherr deleted the fix/493 branch October 3, 2017 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Design Feedback Needs general design feedback.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants