Support » Plugin: Simple Social Icons » Removing plugin's CSS

  • Resolved Sridhar Katakam


    I am looking for a way to dequeue the plugin’s CSS as the presence of !important is creating issues in being able to fully customize via custom CSS.

    I tried adding this code but it results in a fatal error.

    Does anyone have ideas other than directly editing the plugin’s CSS file or forking it?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Got it.

    add_action( 'wp_enqueue_scripts', 'sk_disable_simple_social_icons_styles', 11 );
    function sk_disable_simple_social_icons_styles() {
    	if ( class_exists( 'Simple_Social_Icons_Widget' ) ) {
    		/** Dequeue icon styles */
    		wp_dequeue_style( 'simple-social-icons-font');

    Got help in IRC.

    Plugin Author Ron Rennick


    MultiSite Guru

    I saw your blog post via a retweet from Carrie Dils. Near the end you said

    If there is another reason I do not know of, I would love to be educated.

    The reason you will find !important used in widget CSS by plugin authors is

    – the markup around the widget is dependent on the theme
    – common widget elements are given default styling by the theme
    – in many instances the default styling has a more specific selector

    Ergo, the only recourse a plugin author has to ensure the widget is styled approximately correctly is using the !important.

    The third option you weren’t aware of when you wrote the post is use a more specific selector in your style.css. Because you have a Genesis child theme that selector would be

    .site-container .sidebar .simple-social-icons ul li {
        margin-left: 10px !important;
        margin-right: 10px !important;

    Thank you Ron.

    Ron, that is totally the wrong reason for using !important. Even as far back as 2010, better reasons were given for using it:

    Any CSS in plugins should defer to styles in the theme, not try and mandate the styles with important. The class selector .simple-social-icons ul li is already going to be scoped enough for many cases to target just the list items inside the relative widget. Anything else is up to the theme author.

    You shouldn’t try and force a “plug and go” approach on something with front-end output using !important, since that then forces theme customisers to employ crappy code to get around yours.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Removing plugin's CSS’ is closed to new replies.