Is it a bad idea to “hard code” style sheets in partial HTML views?
For small partial views, it seems preferable to having yet another external style sheet, the reference to which I have to keep track of outside the partial view
For clarification: I am not really talking about the same partial view that would get used many times across a single page – but rather about the same view that would be rendered on many different pages.
How should I manage style sheets for partial views?
Generally, it’s best to put all styles for an entire site into a single CSS file to speed performance. Separate the regions of the style-sheet for various components of your front end by clear comment blocks.
I have stylesheets with 800+ lines, with all declarations for a particular selector on a single line, that add up to 20-30k only. It gets downloaded only once, then it’s cached for every page on your site. Make sure you manage your expires header. Avoid making multiple http requests with separate style sheets.