Closed BrookeDot closed 11 years ago
I agree that we should include CSS with the plugin. However, I don't think it makes sense to include the CSS setting in the shortcode. What happens if someone puts the shortcode on a page twice, once with it on, and once with it off?
I'd say let's just always enqueue the CSS on the front-end. If someone doesn't like the CSS, they can always dequeue it or override the style declarations in their own CSS.
There are also ways of allowing the theme to override views. We could pretty easily do that, so users could create custom markup in their theme. I think that's probably a feature that can wait until the plugin is a bit closer to completion.
Totally misinterpreted the "Close & Comment" button...
My other idea was to look for a contractors.css
file in the active theme folder. I guess for me I'd like to have a very simple way to turn off css that has been added by a plugin. I suppose dequeue
works too though as long as we make it clear/easy to do. Drives me crazy when a plugin adds css but the only want to override it is with !important
// Our code
wp_enqueue_style( 'contractor-directory', ... );
// ...
// Inside the theme's functions.php, or wherever
wp_dequeue_style( 'contractor-directory' );
I feel like that's simple enough that theme developers should be able to do it without too much headache. Similarly, I'd be in favor of not looking for contractors.css
. Again, the theme can just dequeue our CSS and enqueue their own if they want. No need to over-complicate our code for an edge case that has a 1 line work around.
Sounds good, Should I put the CSS in the CSS folder or views?
Let's leave the views folder for PHP layouts. I'm fine with a /css folder. We can either do /css, /images, and /js folders, or we can create one /resources or /assets folder for everything, since we'll probably only have a few files. Up to you.
Hi -
sounds like we have a plan for including CSS that a themer can dequeue as they wish. Sounds clean to me. I just found this discussion area. It was good meeting and working with you two last night.
Thanks, Dean
I was thinking about how this will be released back to the community and think that we need some CSS inside the plugin. I'm thinking something like
wp_enqueue_style
by default then having our shortcode have the argument[contractor-shortcode css=false
to allow the CSS to be turned off.Thoughts?