Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post and the feedback, I really appreciate it!

    I see what you mean, but I have a different opinion here. I’d actually say that most themes don’t have a nice and consistent CSS styling for tables, especially not when the JS functions are also involved. As the TablePress CSS contains CSS code for those controls as well, it’s simply necessary to load those.
    I’m also convinced that a checkbox to turn off loading will not really help. Users will uncheck it accidentally and then be confused as to why their tables look weird (I’ve been through this with TablePress predecessor WP-Table Reloaded, which offered such a checkbox).

    Regards,
    Tobias

    Thread Starter Zachary DuBois

    (@zachary-dubois)

    You could just have it on a per-table basis. For example, I have two tables: One that I want to take advantage of the JS things, one that I just want plain. Implement an option that will just follow the theme (IE, don’t load JS/CSS) so I can have my plain one and then if that isn’t ticked, give me all the JS/CSS features. A brief look at the CSS, there is nothing necessary if you want the theme to control the form.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi Zachary,

    offering such a setting on a per-table basis won’t really work ?? What if both tables were to be displayed on the same page? That default CSS being activated for one table would then still affect the other one. Also, as the CSS has to be included into the page’s <head> section before WP/TablePress actually know if a table will be embedded into the page (which is possible through Shortcodes, template tag functions, and even in sidebar widgets), it will always have to be included. CSS can not really be loaded in the footer (like JS can), as this can otherwise lead to “FOUC” (flash of unstyled content).
    All this is different to the JS code for the DataTables JS library that TablePress uses. For that, a per-table checkbox is possible (and available), as the JS can be loaded in the page’s footer.

    Regards,
    Tobias

    Thread Starter Zachary DuBois

    (@zachary-dubois)

    You could just remove the classes you are adding to the table for the one without the CSS. Thus the table that needs the JS/CSS will get it because the classes/identifiers will be there but the table that doesn’t need it, won’t get it because there is nothing to select it.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    that might be a way, but it would still be weird and might cause more confusion than it solves. I prefer to leave the current way in place, as that has shown to be working well.
    For people who really want to change things, the mentioned filters or using “Custom CSS” to override the default CSS is the preferred and recommended option.
    Sorry if this is not what you had hoped for.

    Regards,
    Tobias

    Thread Starter Zachary DuBois

    (@zachary-dubois)

    .-. No problem

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    Thanks! I hope that TablePress is still useful.

    Best wishes,
    Tobias

    @tobiasbg Can you create a Filter Hook that will suppress loading the default CSS file?

    Something like this: add_filter('load_default_css_from_file', '__return_false');

    This would be handy for those creating a Custom Child Theme who want to use their own Table styles. As a Front-End developer, I find it harder to “override” default CSS than just use the theme’s CSS.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    This exists already. ?? You can use
    add_filter( 'tablepress_use_default_css', '__return_false' );
    Regards,
    Tobias

    awesome! I looked through the code but didn’t see that. Thanks for letting me know.

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Remove CSS (Allow the theme's CSS do what it should do)’ is closed to new replies.