PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Feature request: remove the !important css declarations

  1. The title pretty much says it all.

    Adding !important to the CSS is making it extremely difficult to override the default CSS. There is no good reason to use the !important.

    Please, please, *please* remove it in a future release.

    Posted 8 years ago on Tuesday June 4, 2013 | Permalink
  2. David Peralty

    The reason we use it is to override existing CSS in themes. You can turn off our CSS output if needed in our Forms -> Settings.

    Posted 8 years ago on Tuesday June 4, 2013 | Permalink
  3. I realize that, but that is an all or nothing scenario.

    The !important flags should not be neccessary, as every single element generated by Gravity Forms has a classname and/or ID...

    Posted 8 years ago on Tuesday June 4, 2013 | Permalink
  4. There is no good reason to use the !important

    Well, I'm sad to say that's not the case. If Gravity Forms were on a closed platform and we could control every theme's CSS output then we wouldn't need to do that. That's not the case however. To offer the best "out of the box" styling we have to use the important declaration to override a lot of common CSS inheritance issues.. most of these issues come from poorly coded themes with overly broad CSS rules. I personally prefer not to use the important declaration, but it's necessary to "bulletproof" the form styles as much as we can.

    That said, just as David mentioned above we've added a nifty setting where you can turn off the default Gravity Forms CSS completely and roll your own. You're welcome to do that if you find the important declarations egregious. You can always copy the Gravity Forms styles, remove the important declarations, place the styles at the end of your theme stylesheet and then turn off the Gravity Forms CSS. Just remember, if you do turn off the default output, you'll need to update your CSS when Gravity Forms updates.

    If you don't want to go that route, then you can use better CSS specificity to supersede the important rules in most cases.

    Posted 8 years ago on Tuesday June 4, 2013 | Permalink

This topic has been resolved and has been closed to new replies.