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.

Custom CSS section for each form

  1. It would be awesome to have an input field or something for each specific form where all the custom CSS for that form could live. This way, we could keep it separate from theme CSS.

    This may not be the *best* way to implement this, but some way to access the custom css from within each form and keep things clean by not commingling CSS for different forms and theme CSS would be greatly appreciated. Bonus points if you could implement a live CSS editor in the preview mode or something where CSS change could be seen in real time and then saved.

    Posted 13 years ago on Friday November 18, 2011 | Permalink
  2. You could do this now, if you really wanted to put it inline, using the HTML field. You could add an HTML field to your form at the very top and insert your CSS in a style block within that HTML field.

    An alternative if you want it separate from your theme CSS would be to create your own Gravity Forms specific stylesheet and then update your theme to output it along with it's CSS. Unless you don't want your theme outputting it at all.

    Any reason why you want to keep it separate from your theme CSS? Typically the theme doesn't change very often and that is where most customizations reside so they don't get overridden by plugin updates.

    One thing we will be adding sometime in the near future is the ability for Gravity Forms to identify the existence of a gravityforms.css file in your theme folder and automatically enqueue it when it enqueue it's CSS. What we may be able to do is include an option that could go in the wp-config.php that if present could tell Gravity Forms to look somewhere else for this custom CSS file, such as the wp-content folder, which could be outside of your theme.

    A visual style editor is definitely something we have ideas for. We've avoided it because we strongly believe that the theme should drive the style of the site. But it's still something that we haven't ruled out.

    Posted 13 years ago on Friday November 18, 2011 | Permalink
  3. Thanks Carl. Both of those are good alternatives. As for why I want something like this... I guess it's because, as a very UNprofessional designer, I find it less overwhelming to keep things as segmented as possible. Thinking about it, though, I wonder if I'm a special case and others prefer to have all their site-wide CSS in one place?

    I like the idea of using an HTML field to achieve this; hadn't thought of that. That should also stay intact throughout plug-in updates, shouldn't it?

    Posted 13 years ago on Friday November 18, 2011 | Permalink
  4. Yes, it would stay intact because the HTML field will be attached to the forms you create.

    Posted 13 years ago on Friday November 18, 2011 | Permalink