Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Plugin CSS? #1

Closed
BrookeDot opened this issue Mar 27, 2013 · 7 comments
Closed

In Plugin CSS? #1

BrookeDot opened this issue Mar 27, 2013 · 7 comments
Assignees
Labels

Comments

@BrookeDot
Copy link
Contributor

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?

@ghost ghost assigned BrookeDot Mar 27, 2013
@itsananderson
Copy link

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.

@itsananderson
Copy link

Totally misinterpreted the "Close & Comment" button...

@BrookeDot
Copy link
Contributor Author

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

@itsananderson
Copy link

// 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.

@BrookeDot
Copy link
Contributor Author

Sounds good, Should I put the CSS in the CSS folder or views?

@itsananderson
Copy link

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.

@deanwenick
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants