I am using RequireJS to load stylesheets in an SPA, and then applying the stylesheets dynamically to whatever view the user sees. I am pretty much a web newb and I don't know if it makes sense to dynamically both add and remove stylesheets depending on the view, or should I just add all stylesheets to the document when the application starts up?
I assume in some cases, stylesheets might overlap, i.e. applying different parameters to the same .classes, etc. So surely in some cases it makes sense to remove a stylesheet from the document and add another.
Since this is an SPA, it should be the same document object throughout the application lifecycle, so I can't depend on a page reload to remove stylesheets - I will have to add and remove them explicitly.
I hope this question makes sense.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire