There’s no standard. CSS specificity in themes varies wildly, and I’m convinced many theme authors are not even aware of the concept given some of the CSS I’ve seen.
If something is very important to the appearance of your plugin, then high specificity may be desirable, but in many cases if you’re just styling divs with unique class names, or form elements, then you should keep specificity low so than it can inherit styles from the theme as appropriate.
So really it’s case by case, and you’re not going to be able to guarantee results with all themes. A good rule of thumb is that your specificity should reflect how important it is that the styles are respected.
Related Posts:
- Using standard backend elements in Plugin
- Add CSS animation as Preloader to WordPress
- How do I register a stylesheet inside a WordPress widget?
- Unable to load stylesheets and scripts to plugin settings page
- How do I write into a file (css)
- What would I need to write into a custom plugin in order to add a switch for a custom string of CSS to the edit page?
- Adding CSS to custom post type admin page causes error
- Redirect to another page using contact form 7? [closed]
- Stop Plugin from Getting Styles from Other Plugin
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- Images under 1MB are not being compressed
- change or add css to theme from plugin
- Custom CSS not being added by plugin
- The Events Calendar Plugin – List View Background Colour Issue [closed]
- Themes conflicts and overrides my WordPress Support widget Plugin styles
- Want to create custom design of progress indicator in wpforms
- Two plugins using the same CSS id
- SASS not showing in customized preloader plugin
- WP Plugin CSS not being applied to page
- how to add custom css at top above all css file for specific url
- How to create a “Most Popular” & “Latest” TAB in WordPress
- is_plugin_active function doesn’t exist
- How to call a plugin function from index.php
- Where can I find a schema of wordpress plugin core architecture?
- How can I make my custom shortcode work in a Custom HTML Widget?
- How Does WordPress Uninclude/Deactivate A Plugin?
- Ajax call doesn’t work in frontend but it’s working in backend (when I’m logged in)
- How can I add a custom meta value on file upload?
- Admin-ajax.php is dying “0” without processing function
- Add a Custom Permalink option in the Permalink Admin Screen?
- How to remove an Ajax action
- Has anyone used require.js for handling plugin scripts?
- publish_post plugin hook doesn’t always pass $post->post_content
- Multiple files in a plugin
- Let user subscribe to specific categories
- adding a new value to a serialized array in WP_option table
- Write to / remove from default .htaccess file from plugin?
- How to cancel WordPress’ action/filter when using OOP with anonymous callback
- What is the best way to mimic a search query within a plugin
- Remove rewrite rules generated by plugin during deactivation
- Programatically download a plugin
- Do action only on certain front end pages?
- Call to a member function have_posts() on a non-object on normal loop
- Archive – same title for the first two posts
- CSS from textarea in options page to frontend what to do
- Creating plugin using simple_html_dom parser?
- custom changes removed after plugin update
- Not able to add option in Sub-Menu under page
- Create a navbar filter that filters by a custom field
- wp.media javascript issue with on select
- jQuery for custom plugin not working with Divi theme
- Bootstrap and Custom CSS in custom plugin are being overwritten by theme
- How to inform the user that the save was not successful?
- Creating shortcodes in plugin
- How to use my menu PHP code as sidebar?
- Change plugin name on WordPress repo
- Create a plugin from within WordPress
- Admin AJAX doesn’t work in plugin admin page – Even though code is copied verbatim from WordPress Codex
- Are plugins instantiated on every request to WordPress?
- Render content of multiple pages and their descendants
- Making that Admin Bar transparent or a blue color
- adding a button to the media uploader
- composer not working on my plugin when i upload it to my website
- How to use custom Javascript code inside a plugin?
- How to render a template file using shortcode inside a plugin
- Add background image/layout for single page?
- Does WordPress check for updates of a plugin via plugins root folder name?
- Delete data from custom table when deleting a post
- Disable plugin visibility at the plugin directory
- How do i ‘deactivate’ a plugin only on a certain page template?
- Need to add/remove group of options and display them as rows
- How to deactivate my plugin upon deactivation of NextGen
- Paypal Framework
- Widgets are not displaying in the admin panel
- Order by post_date does not work in Previous and Next post pagination
- Content-Security-Policy implementation with WordPress W3Total Cache plugin installed
- Fatal error “Call to undefined function is_plugin_active” each time the plugin is activated
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- How to get the checkout form data from checkout page when place-order button is clicked
- Getting Fatal error: Uncaught Error: Call to undefined function plugin_dir_path() when linking to another file within my wordpress plugin
- How to make WooCommerce multiple filter with custom meta fields
- How to change the width of certain paragraph or header blocks?
- How to write different events from different functions in my file to a log file in WordPress
- Create a form and have custom menu display based on user answers?
- How to make a plugin api route have permission?
- Modify Plugin PHP Class in Child Theme – Correct Method
- Call function when save setting/option in custom admin page
- Problem with conditional woocommerce custom checkout field
- Plugin to Delete All Posts Monthly
- mailjet plugin – extend functionnalities and reuse api
- Change wp_mail SMTP settings for each E-Mail
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- WordPress Thumbnail add action if no thumbnail
- Creating fields in the database
- Pass strings to plugin function [closed]
- contact form 7 captcha support anyother captcha plugin? [closed]
- How to make content as required in custom post type?
- is_user_logged_in() undefined at shutdown in plugin context
- What are Seeds? [closed]
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode