-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add Custom Styling? #5251
Comments
Can't you use the custom className and provide the className in your theme/plugin assets instead? |
@youknowriad thought of that but how can I make the editor aware of the changes |
The heading block should probably be updated to use the I think we should make this a "good practice" when creating blocks: Always use the |
@youknowriad yeah, but are there actions available when I've used the |
I'm not sure I understand. If you change colors, this should be saved as an attribute of the block and applied in the |
@youknowriad Yes, my thoughts exactly but not all blocks has color and background colors attributes. So how can I add those styles on blocks without the attributes? I'm thinking custom Let me know your thoughts. Thanks! |
Oh I see what you mean, The solution might be to 1- Add support for these attributes in these blocks (this needs approval by design leads because I' don't think we want this for all blocks) |
@youknowriad I've already tried #3 but the changes on styling are not being reflected on the blocks on the editor. Are there any other options? Like assign custom inline styling using |
@youknowriad yeah but I'm thinking of any other options since this might cause an issue in the future updates. Are there any plans on creating hooks to add custom |
@phpbits Not that I'm aware of, because these would be block specific anyway. |
@youknowriad Thanks! I'll think of any other way/hack to achieve what I need ;) I'm trying to stay away with the third option as of the moment. Will probably just add the option w/o the live changes to be reflected on the editor for now. |
I'm leaning towards closing this issue, thoughts @gziolo |
We have 4 ways available to modify blocks at the moment: https://wordpress.org/gutenberg/handbook/extensibility/#modifying-blocks-experimental. You can also try @phpbits feel free to ask more questions in this thread. I'm closing this one because there is no work planned in the near future to add additional filters to what we have already. We want to validate all the existing extensibility points first before we take any further actions. Thanks for understanding. |
@gziolo The problem is that assigning non-existing attributes results to Block Validation error : #4759 (comment) . There's no way to add custom attributes that have live preview. I have this idea : #5360 (comment) and let me know if this is possible. Thanks! |
Hi,
There's no option for custom Inspector Controls to assign custom styling to a block via
props
. Are there any available option to the editor? Like add custom<style>
to element onChange? Thanks!I hope I've expressed my idea well. Tagging you @aduth :) Thanks a lot!
Cheers,
Jeffrey
The text was updated successfully, but these errors were encountered: