Remove inline styles from forms
S
Suzie Gordon
I had to overwrite several styles just to make the form display correctly. I hate doing this to my code. I don't mind writing or copy-pasting the html/css myself. I just want to be able to use a custom html form without any styling (or as plain as possible). Even better if I CAN edit the html.
D
David Lower
Please remove inline styles. This really is criminal. Why would you inline padding of 5px for every submit button? There is just no logical reason for it. Why give us the ability to add our own classes when you have so many inline styles? Classes do not override inline styles.
Paul Schiretz
Yes please, it is really annoying as a theme developer. By the way adding a <style> tag inside a div as it is done now in front_end_form.html to render styles in isn't even valid html. Please remove them, or at least provide an argument for the shortcode to ignore the style, life would be a lot easier!
M
Martin M
Paul Schiretz: I don't understand it either, as a theme developer it's really not possible to produce clean valid HTML with the Mailpoet plugin. When I check my HTML code with a markup validation service Mailpoet is the only plugin that does not output valid HTML code.
Paul Schiretz
Martin M: i fixed this by using some regex magic in my theme, to filter out the style tag, not sure if the solution is for everyone but it works out fine for me. I use the shortcode methode to display my subscription form. There is a filter hook that filters the rendered shortcode output. I don't remember the code by hard but if you are interessted i can look it up and share it here as soon as i'm back at my computer :-)
Paul Schiretz
Martin M: Here is my code don't know if it works for everyone but it's working fine for me:
i use the removeStyleFromMailpoetRegistrationForm filter to remove the style tags with a regex.
Please take a look at the screenshot for the full code as if i post code here it's strips some characters.... sorry about that.
Just add the code from the screenshot to your functions.php and your html should be valid and the inline styles gone.
Cheers,
Paul
M
Martin M
Paul Schiretz: Can you possibly post the code here so that I can copy and paste it?
Paul Schiretz
Martin M: I'm sorry but if i post code here it always strips out some characters. just retype the code from the screenshot...
Raphael Haze
please remove the inline styles!
Pablo Miralles
Maybe I should bump this because it's really a problem. Use Mailpoet Forms is equal to use styles with importants fixed those inline style.
ptrnca
yes please!