Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

[QUESTION] Angular2 template migration to per-component styles #326

Closed
rbasniak opened this issue Sep 21, 2016 · 1 comment
Closed

[QUESTION] Angular2 template migration to per-component styles #326

rbasniak opened this issue Sep 21, 2016 · 1 comment

Comments

@rbasniak
Copy link

I saw the last update on Angular2 changed to per-component scoped styles, and completely removed the global styles.

Doesn't it make sense to have a application wide style like it was before, and also some per-component styles just to exemplify how to do it?

Please correct if I'm wrong, but as it is now, I understand that if I create a global stylesheet it won't be included in the bundle anymore. This way if I have some styles that are used in more than one component, I'll have to duplicate the code...

@SteveSandersonMS
Copy link
Member

SteveSandersonMS commented Sep 21, 2016

If you do want a global stylesheet, there are various ways to add one, e.g., as documented at https://github.com/aspnet/JavaScriptServices/tree/dev/src/Microsoft.AspNetCore.SpaServices#example-a-simple-webpack-setup-that-builds-less

Or even just by adding a .css file to wwwroot/ and then referencing it using a <link rel=stylesheet> tag in your layout :)

So yes, you're right, it does make sense. For the template we're just trying to minimise concept count (with additional concepts covered by docs or at least standard practices) rather than putting all features in the out-of-the-box set of files. Hope that seems reasonable!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants