felixarntz / bootstrap-for-contact-form-7

This plugin modifies the output of the popular Contact Form 7 plugin to be styled in compliance with themes using the Bootstrap CSS framework.
https://wordpress.org/plugins/bootstrap-for-contact-form-7/
GNU General Public License v2.0
24 stars 18 forks source link

Inline CSS #32

Closed bambamboole closed 7 years ago

bambamboole commented 8 years ago

Since I activated this plugin, I get this inline css

<style type="text/css">
        div.wpcf7 .screen-reader-response {
            display: none;
        }
        div.wpcf7 img.ajax-loader {
            border: none;
            vertical-align: middle;
            margin-left: 4px;
        }
        div.wpcf7 .form-inline img.ajax-loader {
            display: inline;
        }
        div.wpcf7 div.ajax-error {
            display: none;
        }
        div.wpcf7 .wpcf7-display-none {
            display: none;
        }
        div.wpcf7 .form-inline .form-group {
            max-width: 250px;
        }
        div.wpcf7 .input-group-addon img {
            height: 100%;
            width: auto;
            max-width: none !important;
            border-radius: 5px;
        }
        div.wpcf7 .input-group-addon.input-group-has-image {
            padding: 0;
        }
    </style>

what the hell?

Why is there this inline css and how can I disable it ?

cheers

felixarntz commented 8 years ago

The CSS is required for some additional adjustment of CF7 styles. It is impossible to automatically detect whether the current page contains a contact form, so it loads everywhere by default. I didn't want to put it into a separate stylesheet since it is just a few lines and it would have been an additional request each time - but you're right, it should probably be in its own file.

As for generally deactivating CSS, this can only be done programmatically, similar to the regular CF7 plugin.

For example you can put this code in your theme:

remove_action( 'wp_head', 'cf7bs_inline_styles' );