-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Implement styleselect equivalent for inline/CSS-class formatting #773
Comments
styleselect
equivalent for inline/CSS-class formatting
Seems like the freeform block should potentially be able to support this: I think of it freeform block as essentially the old editor in block form. |
That seems like a good path forward. The more I think about it, the scope of such a feature should probably be limited to applying inline CSS classes and/or markup (like |
We have support for additional classes to be added via the inspector, so closing as covering the original intention. |
@mtias Thanks for paying some attention to this ticket. While adding a class to a block is useful for developers and power users, it is not the original intention of the ticket nor is it remotely close to feature parity with the In brief:
If you refer back to the screenshot, I think you'll see all of these aspects and hopefully understand why a textbox for CSS classes is a totally different feature and usecase. |
@mrwweb apologies, I've been going through piles of issues today and my brain is a bit exhausted. The screenshot shows what should really become blocks under gutenberg, discoverable in the main inserter. (We have a pull quote block already, for instance, and the others could likely be custom blocks provided by you to your users.) That's the whole point of blocks, to avoid users remembering markup or classes. It'd be good to have more examples of what sort of inline treatments would be useful to have to figure out how to handle them. |
@mtias not a problem. I kinda of figured this was at the end of a bug scrub. Thanks for all your work. You're right that the first drop-down shown is basically blocks and the second contains some styles of blocks, but here are some examples where I don't see a current way to handle with Gutenberg:
More than anything, I'd like to highlight that in both this ticket and #783 (basically this request but for blocks), the ability for the theme to define user-facing Names for classes and styles is incredibly powerful and useful. A CSS class field is useful, but my experiencing training users to use similar features (such as in the Make theme), it doesn't really "stick" for users and they always have to refer back to documentation to remember class names. It's also worth noting that both tickets almost certainly require some form of editor styles (#422) so that applying the class to the editing interface can result in the user seeing what the theme has applied. |
The above is still possible, but to do that i need to click on Edit HTML and add the span element manually. In the old classic editor, all I need to do is to
|
Following up on @tekTutorialsHub's comment, #783 addressed block style variants (quite successfully!), but not inline style variants within text. That was the other place that Maybe this issue can be reopened? It's certainly a clearly-defined regression from the Classic Editor extensibility. |
I think this is covered in #4658 which is still open. Definitely recommend following along there. |
Current TinyMCE (and therefore the WordPress post editor) supports the
styleselect
. This is an excellent way to allow editors to apply classes to HTML elements which is a great way to handle inline formatting like making a button or non-wrapper-block-element formatting like giving a paragraph a "Notice" or "Intro text" style.I currently don't see how this type of formatting would work with this editor, but losing this ability would be a huge loss for applying this kind of inline/simple formatting.
Is re-implementing this type of feature on the roadmap at all? Is there another way this could be handled? Making an entire block type just for a "button" feels like overkill and doesn't address the ability to create inline span styles.
Here's a screenshot on a site I've implemented it on:
The text was updated successfully, but these errors were encountered: