Support » Plugin: Feature A Page Widget » Why do you set all new css?

  • Resolved graftedin

    (@graftedin)


    Why do you reset our css? Stuff like extra margins and padding around the widget h3, or line-height, etc……THIS STUFF IS ALREADY SET BY OUR THEME! And now we have to reset it because you assume we don’t know how to style our stuff and force your own styles on us.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author mrwweb

    (@mrwweb)

    Hi @graftedin. Sorry to hear you’re frustrated by these styles.

    There are a very limited number of low-specificity styles that generally improve the look of the widget, especially when testing with default themes. It’s impossible for a plugin to write CSS that has the perfect balance of providing consistent results and never interfering with the theme styles. I’ve done my best.

    If you’d like, you can remove all the plugin styles with wp_dequeue_style(). Here’s an untested example that I would expect to work:

    function fpw_dequeue_front_end_styles() {
        wp_dequeue_style( 'fpw_styles_css' );
    }
    add_action( 'wp_enqueue_scripts', 'fpw_dequeue_front_end_styles' );

    If you do that, you’ll need to reimplement the layout CSS as well.

    There is a starter CSS file in the plugin to help you quickly reference all the selectors.

    Alternately, it sounds like maybe you just need a tiny bit of custom CSS to resolve the issue:

    .fpw-page-title {
            margin: {your preferred value};
            padding: {your preferred value};
            font-size: inherit;
            line-height: inherit;
    }

    I need you to not reset styles themes would set. If this was a plugin that displayed content in a format that no one else uses I understand that you’d set some styles for that. But this is a widget…..there are widgets for EVERYTHING! I don’t want to reset those styles for every type of widget I install.

    Most themes will have a style set for widget headers, h3 and for line height. If they don’t that’s their problem. Its easier for me to add more styles if needed than to overwrite styles because overwriting means I have to use longer and more css hooks to overwrite. That means I have to set styles multiple times rather than once and can lead to more inconsistent styles.

    So much of my time is spent just overwriting styles from plugins that assume the the world revolves around them.

    At the very least your trick to dequeue your styles should be a check box option. Look at the way https://wordpress.org/plugins/recent-posts-widget-extended/ does it. Their check box wasn’t working but they are on the right track with their approach. I was still able to remove the styles with out making a function.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.