• Resolved brad hogan

    (@bradley2083)


    Hey, thanks for making this plugin. Would love if the button styles could just pull from the defaults of the theme. I think it might need to be wrapped in .wp-block-button and then have .wp-block-button__link and .wp-element-button applied to the actual input button, but not 100% sure. Any way to make an update for this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hi @bradley2083,

    In fact, that could be a new theme/style (maybe you have noticed that there is this in the settings of the block). I could do that.

    Thing is like I don’t feel like it will work with your theme or any theme; I am not sure there is a standard way to develope contact form right now (as the other contact forms are pretty famous, they all have their styles and so on).

    But you know that if you pick “None” as the style, it’s fairly simple, and that works with most themes?

    You can try choosing that one, then maybe play with the code in run.php. Have a look at the function create_form. Look at this line:

    $css = array(
      'root' => $bCSS,
      'theme' => "meow-contact-form--${theme}",
      'group' => "${bCSS}__group",
      'info' => "${bCSS}__info",
      'label' => "${bCSS}__group-label",
      'input' => "${bCSS}__group-input",
      'textarea' => "${bCSS}__group-textarea",
      'button' => "${bCSS}__group-button"
    );

    You can add a class right before the one I generate dynamically. You might get interesting results.

    Would love to know if something good happens with your theme (and which theme you are using) ??

    Thread Starter brad hogan

    (@bradley2083)

    Thanks for the reply. As of right now, none of the three options you have for styles will simply use the fallback theme (even the default Twenty Twenty Two theme) button style. This isn’t necessarily limited to just your plugin. It appears to be an issue with any buttons that are not added as an actual block. If a button block exists on the page above your form (or any input button for that matter), the styles work (apparently because they are inline styles when adding a button block in Gutenberg).

    Would love to see if you have any thoughts on how to make it so your button styles would take the default button block styles without another button being present on the page.

    I’m using a block theme called Block Themes Pro (blockthemespro.com). I’m actually the designer / dev of these. Would love to feature your plugin as the go-to solution for contact forms. I just need to sort out this issue.

    Cheers ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Take button styles from theme’ is closed to new replies.