JavaScript for WordPress Forums Gutenberg Development Add style format select in richtext toolbar

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #134401
    ldecoker
    Participant

    Hello!

    before Gutenberg, I added custom style format using ‘tiny_mce_before_init’ and the ‘style_formats’ variable. With gutenberg, this is not used anymore. How can I replace it? I found a guideline to add a button in the richtext toolbar but if I need to add a button for each style format, my list will be quite big.

    Thx in advance!

    #134402
    Zac Gordon
    Keymaster

    What is it exactly you’re trying to style?

    #134403
    ldecoker
    Participant

    Hello Zac,

    Text in paragraph block. For example, by selecting a portion of the text and applying a class (in a span tag for example). Then with css, I can do whatever I want as style (color, font, icon, ..)

    #134404
    Zac Gordon
    Keymaster

    You want to look into the formatting API for this I believe then 🙂

    https://developer.wordpress.org/block-editor/tutorials/format-api/

    #134535
    ldecoker
    Participant

    Hi Zac,

    That was indeed the documentation I used but this would add a single button to the paragraph block. I have several formatting option and would like to add it in a select. Do you know if this is possible?

    thx!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.