Search code examples
htmlcsswordpresswordpress-plugin-creation

Styling in Wordpress Plugin development


I am trying to build a plugin for my business, where it outputs some tables on the frontend when called form a shortcode. I know how to do the coding, but I am unsure as to how I can style it? Normally I would just use Bootstrap, but it seems rather excessive. More over, I fear for conflicts if bootstrap is already included by the theme the site is running. Even though the plugin is only for internal usage I can't make sure that it will always be used with the same theme.

Am I missing something obvious or is it a complicated matter?


Solution

  • I usually use a main stylesheet for my themes or even inline-styling for relatively small or admin-side plugins, but here is what I would do in your situation:

    If you think most of the themes this plugin will be used with will have bootstrap included, use bootstrap. But... include some generic classes as well so that if someone uses your plugin without bootstrap for whatever reason, they can still use those classes to work with/style the plugin their own way and your bootstrap classes will just be ingnored.