Hi Helen,
This was an intentional change. Previously, if your custom stylesheet was overwritten (which would happen during plugin updates if the custom stylesheet was placed in the plugin directory), there would be no default stylesheet to fall back on. This would cause layout problems, especially for calendar grids (there’s a very important display:none
in there!).
Now, your custom stylesheet is always enqueued after the default plugin stylesheet, so as long as your style rules are correctly defined (i.e specific enough), the default styles won’t override your custom ones. This also means you only need to include the styles you want to override in your custom stylesheet, not everything from the default.
By styles.css
, do you mean your theme’s stylesheet? I don’t think it’s a good idea to rely on the theme stylesheet, as if you change your theme, the styles would be lost, and the same layout issues mentioned above would occur.
If you do still want to stop the default stylesheet from loading, you could add the following to the theme’s functions.php
file:
add_action('wp_print_styles', 'deregister_gce_stylesheet', 100);
function deregister_gce_stylesheet(){
wp_deregister_style('gce_styles');
}
This would cause only your custom stylesheet to load. I would advise against doing this for the reasons discussed, but if you’re sure that your custom stylesheet won’t get lost / overwritten, then this will work.
Also, if you did want to rely on your theme’s stylesheet, and not load any plugin stylesheets, you would adjust the above code to this:
add_action('wp_print_styles', 'deregister_gce_stylesheet', 100);
function deregister_gce_stylesheet(){
wp_deregister_style('gce_styles');
wp_deregister_style('gce_custom_styles');
}
Again, not recommended!
I hope this helps, let me know if you have any further questions.
Ross.