My perspective on CSS files is that they describe the rules that define the theme of the application. Best practices usually suggest that content, presentation and behavior should be kept separate, so itβs relatively easy to change the subject. Having multiple CSS files makes this a bit more complicated as the designer will have more files to process.
In addition, CSS (Cascading StyleSheets) rules depend on their position in the CSS document. Having in each case several CSS files with different rules, it can be difficult to prioritize which rules take precedence.
Finally, if you want to find out which CSS selector in your JS file matches that CSS file, try using a cool search tool like grep if you are using linux. If you use a good IDE, you can also use it to quickly find rules, then you can just go to the line number. I really don't see the benefit of following CSS rules in different files; this will only complicate the situation.
In addition, I would advise you to abandon the idea of ββembedding CSS. By doing this, you inevitably complicate the ability for your web designer to quickly and easily change styles. The whole point of external CSS is that your web designer can change the theme or provide multiple themes for different users. If you embed CSS in JavaScript or HTML, then you tightly connect content, behavior, and presentation.
Best practices typically preserve content, behavior, and presentation separately for this very purpose.
source share