Custom CSS Box vs Child's Theme folder

I was able to get the Contact Widget Form working on my site.

However, my css changes were placed in the child's folder in the member.css and then in the widget itself Custom CSS box and they both worked ok. Of course I deleted my changes from the member.css prior to placing it in the Custom CSS box.

But what's the difference? Or a better question might be why would I want to place it in the widget itself as opposed to the child's them folder?

Thanks

    Mason

    Hiya drdave,

    why would I want to place it in the widget itself as opposed to the child's them folder?

    Good question and an important one.

    Common sense says to put all your custom CSS into the child theme's folder. That's what it's there for right? And in most cases, that is entirely correct. In fact, if you put that CSS in your theme folder in this instance there wouldn't be anything particularly wrong with that.

    So why put it in the widget? Why did we even give the option? Well, I can think of a couple reasons:
    1. Because this widget is meant to allow you to customize it independent of the theme. You could change your theme and this widget will keep its styling. Pretty handy!
    2. You could have multiple forms for different reasons and want to style them differently so that they stand out from one another. Being able to easily style them from within the widget itself becomes valuable in this instance as well.

    Ultimately, the idea behind keeping the CSS separate is so that it's easier to find later and so that you don't lose your changes on an upgrade. The CSS in this widget isn't contained in the install file, so it's safe for upgrades - both for the plugin and any theme.

    Hope this helps!

    drdave

    1.
    Because this widget is meant to allow you to customize it independent of the theme. You could change your theme and this widget will keep its styling. Pretty handy!

    True but since I already done so much customizing to my theme I doubt it's going anywhere. But I see what you mean.

    You could have multiple forms for different reasons and want to style them differently so that they stand out from one another. Being able to easily style them from within the widget itself becomes valuable in this instance as well.

    Hmm! Good point!

    However I am kinda finicky. I install a plugin today, I might remove it tomorrow and might put it back the next day. Now all my changes are gone? Or is it? Seems like even though you remove a plugin the changes are kept so I am assuming it's stays stored in the database maybe? If so, then my second assumption is, if I optimize my database then my changes are gone for good.

    I know that won't be anyone's problem either way but a result of my own bad habits but I was just wondering.

    Thanks for the light masonjames.