Where to put styles in a VS Project
-
21-01-2021 - |
Question
I'm developing a SharePoint feature, I already know where to put custom layouts and templates, but can't find helps where to put .css
styles.
I'm not asking how to reference an existing file in any (master)page, I'm looking for the correct way to add a css file in my project in order it gets deployed with the other files.
I tried with the Styles
folder, but during the deploy it seems to get ignored.
Where should I put my ths css?
Solution
I would place it under the Layouts folder.
Project > Layouts > [solutionname] > Styles > cssfile.css
By placing it here Visual Studio automatically sets the Deployment Location and Deployment Type
This article has a good approach on howto place your files. SharePoint Farm Solution Project Structure
Also this article from Microsft explains how packaging and deployment works. Package and deploy SharePoint solutions