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

Gutenboarding: hide block UI via CSS #37225

Merged
merged 3 commits into from
Nov 5, 2019

Conversation

simison
Copy link
Member

@simison simison commented Oct 31, 2019

Hide block UI with CSS overrides.

Not great, but it seems like there isn't a core provided mechanism just yet (WordPress/gutenberg#7469).

Once WordPress/gutenberg#18173 lands and is available via NPM, we can hide UI via JS with props in BlockList.

I grabbed the override from FSE — this could very well be a sass mixin or function that is shared between FSE and Gutenboarding, but I didn't feel like doing that because we can have core provided mechanism soonish.

Changes proposed in this Pull Request

Testing instructions

  • Check /gutenboarding

Before
Screenshot 2019-10-31 at 16 57 45

After
Screenshot 2019-10-31 at 16 57 26

@simison simison added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Goal] Gutenberg Working towards full integration with Gutenberg [Feature Group] Signup & Site Onboarding Tools for user registration and onboarding new users to the site. labels Oct 31, 2019
@simison simison requested a review from a team October 31, 2019 15:00
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Oct 31, 2019

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~7 bytes added 📈 [gzipped])

name                 parsed_size           gzip_size
entry-gutenboarding        +34 B  (+0.0%)       +7 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

Copy link
Contributor

@ockham ockham left a comment

Choose a reason for hiding this comment

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

This appears to be working well; however, I'm a bit worried that it might spill into other Gutenberg instances inside of Calypso? As you point out, FSE also uses the block-editor-block-list__layout selector; the toolbar still seems to work there, but that might be due to the way it's built and deployed to WP.com (independently from Calypso). I think there might be potential for spillage if there will be other Gutenberg instances in Calypso, aside from Gutenboarding 🤔

Let's maybe move it into a .gutenboarding block-editor__container selector?

@sirreal
Copy link
Member

sirreal commented Nov 4, 2019

BlockList accepts a className prop (DefinitelyTyped/DefinitelyTyped#40127).

I've added a className and used that here instead of the standard className. That should keep this nicely isolated.

Copy link
Member

@sirreal sirreal left a comment

Choose a reason for hiding this comment

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

This seems good for now, thanks for documenting the issue/PR that will allow us to remove this workaround as well ✨

@sirreal sirreal added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Nov 4, 2019
@sirreal sirreal merged commit f701b73 into master Nov 5, 2019
@sirreal sirreal deleted the update/gutenboarding-hide-block-ui-css branch November 5, 2019 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] Signup & Site Onboarding Tools for user registration and onboarding new users to the site. [Goal] Gutenberg Working towards full integration with Gutenberg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants