-
Notifications
You must be signed in to change notification settings - Fork 12k
Compile component styles into styles.bundle.css #7219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is actually by design. Component styles are isolated and get special handling by the AOT compiler. So in that sense there is no point to try and put it in the global styles. #1253 is solved by importing the css variables into the component css. It might be tedious, but it is correct since they are isolated. If you don't care about the isolation you can turn view encapsulation off and just use global styles anyway. |
Since inline styles are violating CSP, then Angular 2 becomes unusable in environments that require the use of restrictive CSP |
Google page speed checker is mark inline styles like a uncompressed tex, and gives a strike( |
Imagine such case:
That's really, really bad idea. |
You dont have to use component styles. Component styles are lazy loaded with the corresponding module and applied using shadow dom (emulation). They have tons of benefits but are not made for usage outside at all. But you can write your global styles they are great for overall styling and also import your global variables and mixins into component styles. I think it is correct that this issue is closed. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Versions.
v1.3.0-rc.3
Repro steps.
Compile (ng start / build) with
--extract-css true
. Styles set in.angular-cli.json
will be bundled into a single file (correct). Component styles are still inline (and, btw, have no sourcemaps).Further question
Is it possible to concat component-styles with the main style.bundle.css to have a single css-file only? If this is done before sass runs, this would also solve #1253
The text was updated successfully, but these errors were encountered: