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

global styles slotfill #66282

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

rinkalpagdar
Copy link
Contributor

What?

Fixes #48068

How?

This PR introduces a new SlotFill location in the global styles section.

Testing Instructions

  1. Checkout this branch and build
  2. Add the sample code below in your theme or plugin
  3. Confirm that slot appears as seen in the screenshot
import { registerPlugin } from '@wordpress/plugins';
import { HelpContentSlot } from '@wordpress/edit-site';

// Define a basic component to render the help content inside the slot.
const HelpContent = () => (
	<HelpContentSlot
		renderContent={ () => (
			<p>This is your help content displayed in the slot.</p>
		) }
	/>
);

// Register the plugin.
registerPlugin( 'my-help-content-plugin', {
	render: HelpContent,
} );

Screenshots or screencast

Global styles

Copy link

github-actions bot commented Oct 21, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: rinkalpagdar <[email protected]>
Co-authored-by: carolinan <[email protected]>
Co-authored-by: ndiego <[email protected]>
Co-authored-by: Copons <[email protected]>
Co-authored-by: erikyo <[email protected]>
Co-authored-by: mtias <[email protected]>
Co-authored-by: oandregal <[email protected]>
Co-authored-by: jorgefilipecosta <[email protected]>
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: mmtr <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @rinkalpagdar! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Oct 21, 2024
@carolinan
Copy link
Contributor

carolinan commented Oct 23, 2024

Hi @rinkalpagdar Thank you for working on this issue.
-I am unsure of the name, "HelpContent" since it might be used for other things than contextual help.
I think it may be more suitable to use a name that makes it easer to understand where the slot is?
Also I think there needs to be more discussion about the position of the slot.

@carolinan carolinan added [Type] Enhancement A suggestion for improvement. [Feature] Extensibility The ability to extend blocks or the editing experience labels Oct 23, 2024
@rinkalpagdar
Copy link
Contributor Author

Hello @carolinan Thanks for the feedback. Can you please suggest the name of the slot? I think the place for the slot would be great above the "browse style" . Please share your thoughts on the same. Thanks!

@ndiego
Copy link
Member

ndiego commented Oct 24, 2024

Since questions remain in the original issue about whether this slot should be added, naming aside, can we add the isGutenbergPlugin check as Riad describes here?

@carolinan
Copy link
Contributor

I think the place for the slot would be great above the "browse style"

I disagree, because the preview above it shows what you have selected in "Browse style", and I feel strongly that these two elements should not be separated by the slot. But this is my personal opinion.

@rinkalpagdar
Copy link
Contributor Author

Hello @ndiego Thanks for the feedback. I have added the isGutenbergPlugin check.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide ways to extend/customize the Global Styles sidebar
3 participants