Ready to get started?Download WordPress


Simple Social Icons
[resolved] Removing plugin's CSS (4 posts)

  1. Sridhar Katakam
    Posted 8 months ago #

    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?


  2. Sridhar Katakam
    Posted 8 months ago #

    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.

  3. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 8 months ago #

    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;
  4. Sridhar Katakam
    Posted 8 months ago #

    Thank you Ron.


You must log in to post.

About this Plugin

About this Topic