Normally in a plugin I would add styles using wp_enqueue_style. However, I am currently creating a plugin that only needs a few lines of CSS and I am wondering if it might be better to serve the styles inline to save a request. Obviously there are many advantages to using wp_enqueue_style, but are they worth the extra request for such a small piece of CSS? Is there any accepted 'best practice' in this area?
Using external stylesheet
Using inline styles
Normally I would say: Sure, if you are the only one using it, go ahead and do it inline. But you are talking about a plugin which means the code will be public so aim for extendibility. Right now you only have a few lines of styling:
|show 3 more comments|
This is hard to answer and I am really not sure if there is an official answer.
I understand the sentiment about saving a request but inline style pretty much always wins. A theme or end user will have a hard time altering your CSS.
With that in mind, I think I'd do this in a publicly released plugin...