Loading shortcode stylesheet only when shortcode is in text widget [closed]

I think you should be able to register your stylesheet with wp_register_style(), then load the stylesheet via wp_enqueue_style() from within the shortcode’s function, so it only loads when the shortcode is executed.

For a rundown on how this will work here’s a good article. It refers to scripts, but I believe the same is true for styles: http://mikejolley.com/2013/12/sensible-script-enqueuing-shortcodes/

(Also, if you need shortcodes to run in text widgets be sure to add this to your plugin or functions.php file: add_filter('widget_text', 'do_shortcode');)

tech