I would like to add CSS to a page or a shortcode (preferably a shortcode) that would not be dependent on a theme, a plug-in or anything.
I tried adding wp_enqueue_style('[my-css-url]');
to various PHP files but without success. Yet I would expect more proper ways to do it.
I there a way to do that?
This question is not a duplicate of Enqueue Scripts / Styles when shortcode is present That other question is asked and solved in the context of a plug-in. My question clearly state "independant from plug-ins".
wp_enqueue_style()
calls in random files is inadvisable and likely to produce undesirable side-effects - or simply erase your changes the next time WordPress updates. Make a small plugin to house your modifications, or let us discuss why you believe you cannot use a plugin.