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

Improve code block style #1630

Merged
merged 5 commits into from
Dec 2, 2019
Merged

Conversation

SergioEstevao
Copy link
Contributor

@SergioEstevao SergioEstevao commented Nov 27, 2019

Fixes #368

This PR improves the style of the code block by:

  • Change the font to Menlo size 14pt
  • Add paddings has indicated in the ticket
  • Adds a border like in the web block

CodeDarkLight

Gutenberg PR: WordPress/gutenberg#18785

To test:

  • Open the demo app
  • Create a new code block
  • Edit the block and see if all looks good

Update release notes:

  • If there are user facing changes, I have added an item to RELEASE-NOTES.txt.

@SergioEstevao SergioEstevao added the [Status] Needs Design Review Needs design review or sign-off before shipping label Nov 27, 2019
@SergioEstevao SergioEstevao added this to the 1.19 milestone Nov 27, 2019
@iamthomasbishop
Copy link
Contributor

👋 Nice work, @SergioEstevao, I have updated the block blueprint - here is the latest:

image

  • For the body background, we can use the same as the pre block
  • No border
  • Not sure what you've got applied here, but padding within the content area can be set to: 12px on top/bottom, 16px on left/right

Looks good to me other than those things! 👍

@SergioEstevao
Copy link
Contributor Author

SergioEstevao commented Nov 27, 2019

@iamthomasbishop, thanks for the feedback, one question though, if I apply your suggestion what will make it different from the pre block visually?

After you write some text they will look exactly the same in the editor, no?

@iamthomasbishop
Copy link
Contributor

if I apply your suggestion what will make it different from the pre block visually?

The main diff is the background fill color. In your example the background looks white, and the block content area should have a dim color fill (one of the light grays in light mode, a dark gray in dark mode) to match the pre block style.

After you write some text they will look exactly the same in the editor, no?

In terms of the contents of the block, static and selected states look the same, just like other text-based blocks.

Copy link
Member

@koke koke left a comment

Choose a reason for hiding this comment

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

Code-wise this looks good, except for one comment I left in the other PR. From what I understand this still needs some design updates, let me know when those are ready and I'll do some final testing

@SergioEstevao
Copy link
Contributor Author

@koke design is updated to follow @iamthomasbishop recomendations, can you please give it another look?

Copy link
Member

@koke koke left a comment

Choose a reason for hiding this comment

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

This is looking good. The font looks slightly different on Android, but I'm not sure how to test if it's actually Menlo

Screen Shot 2019-12-02 at 12 59 23

@SergioEstevao
Copy link
Contributor Author

@koke I didn't change the font in Android, that still specifies monospace, that I'm assuming defaults to Roboto Mono.

@iamthomasbishop do we want Menlo in Android to?

@iamthomasbishop
Copy link
Contributor

@SergioEstevao I was assuming we'd use Menlo on iOS (considering it's either the default or at least an available font on iOS) and fall back to the default Roboto Mono on Android. Are we able to use Menlo on Android as well?

@SergioEstevao
Copy link
Contributor Author

@iamthomasbishop just confirmed with @maxme that for Android there is only one mono font by default and it's Roboto Mono. So we will keep that in Android and use Menlo in iOS.

So all is ok with PR and I will merge it :).

@iamthomasbishop
Copy link
Contributor

Sounds good! :shipit:

@SergioEstevao SergioEstevao removed the [Status] Needs Design Review Needs design review or sign-off before shipping label Dec 2, 2019
@SergioEstevao SergioEstevao merged commit f091d71 into develop Dec 2, 2019
@SergioEstevao SergioEstevao deleted the issue/368_improve_code_block branch December 2, 2019 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve style of code block
3 participants