{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/1124","labels_url":"https://api.github.com/repos/angular/angular/issues/1124/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/1124/comments","events_url":"https://api.github.com/repos/angular/angular/issues/1124/events","html_url":"https://github.com/angular/angular/issues/1124","id":64600975,"number":1124,"title":"Caching/code-gen story for CSS needed","user":{"login":"matanlurey","id":168174,"avatar_url":"https://avatars.githubusercontent.com/u/168174?v=3","gravatar_id":"","url":"https://api.github.com/users/matanlurey","html_url":"https://github.com/matanlurey","followers_url":"https://api.github.com/users/matanlurey/followers","following_url":"https://api.github.com/users/matanlurey/following{/other_user}","gists_url":"https://api.github.com/users/matanlurey/gists{/gist_id}","starred_url":"https://api.github.com/users/matanlurey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matanlurey/subscriptions","organizations_url":"https://api.github.com/users/matanlurey/orgs","repos_url":"https://api.github.com/users/matanlurey/repos","events_url":"https://api.github.com/users/matanlurey/events{/privacy}","received_events_url":"https://api.github.com/users/matanlurey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"mhevery","id":111951,"avatar_url":"https://avatars.githubusercontent.com/u/111951?v=3","gravatar_id":"","url":"https://api.github.com/users/mhevery","html_url":"https://github.com/mhevery","followers_url":"https://api.github.com/users/mhevery/followers","following_url":"https://api.github.com/users/mhevery/following{/other_user}","gists_url":"https://api.github.com/users/mhevery/gists{/gist_id}","starred_url":"https://api.github.com/users/mhevery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhevery/subscriptions","organizations_url":"https://api.github.com/users/mhevery/orgs","repos_url":"https://api.github.com/users/mhevery/repos","events_url":"https://api.github.com/users/mhevery/events{/privacy}","received_events_url":"https://api.github.com/users/mhevery/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/angular/angular/milestones/21","html_url":"https://github.com/angular/angular/milestones/M7:%20GT%20Customer","labels_url":"https://api.github.com/repos/angular/angular/milestones/21/labels","id":1036683,"number":21,"title":"M7: GT Customer","description":"","creator":{"login":"mhevery","id":111951,"avatar_url":"https://avatars.githubusercontent.com/u/111951?v=3","gravatar_id":"","url":"https://api.github.com/users/mhevery","html_url":"https://github.com/mhevery","followers_url":"https://api.github.com/users/mhevery/followers","following_url":"https://api.github.com/users/mhevery/following{/other_user}","gists_url":"https://api.github.com/users/mhevery/gists{/gist_id}","starred_url":"https://api.github.com/users/mhevery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhevery/subscriptions","organizations_url":"https://api.github.com/users/mhevery/orgs","repos_url":"https://api.github.com/users/mhevery/repos","events_url":"https://api.github.com/users/mhevery/events{/privacy}","received_events_url":"https://api.github.com/users/mhevery/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":4,"state":"open","created_at":"2015-03-24T16:31:29Z","updated_at":"2015-03-27T20:27:43Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-03-26T18:26:56Z","updated_at":"2015-03-27T20:54:00Z","closed_at":null,"body":"Spoke briefly with @jelbourn, but it looks like the Angular 2 \"way\" to use CSS in a component is:\r\n\r\n```html\r\n<style>@import \"style.css\";</style>\r\n<div>\r\n  ...\r\n</div>\r\n```\r\n\r\nFor templates, we use the `Template` annotation:\r\n\r\n```dart\r\n@Template(\r\n  url: \"my_component.html\"\r\n)\r\n```\r\n\r\nThe advantage of this is a pre-compile step can do static analysis, and convert URLs into an inline of the HTML, reducing the number of HTTP requests and files needed for a statically generated application. In angular 1, this was called `\"template_cache\"`.\r\n\r\nIf the official stance of Angular 2 is using `<style>@import</style>`, will this be something that is also scanned and in-lined in applications that use static analysis? \r\n\r\n++ @kegluneq, @mhevery, @yjbanov "},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/87089193","html_url":"https://github.com/angular/angular/issues/1124#issuecomment-87089193","issue_url":"https://api.github.com/repos/angular/angular/issues/1124","id":87089193,"user":{"login":"yjbanov","id":211513,"avatar_url":"https://avatars.githubusercontent.com/u/211513?v=3","gravatar_id":"","url":"https://api.github.com/users/yjbanov","html_url":"https://github.com/yjbanov","followers_url":"https://api.github.com/users/yjbanov/followers","following_url":"https://api.github.com/users/yjbanov/following{/other_user}","gists_url":"https://api.github.com/users/yjbanov/gists{/gist_id}","starred_url":"https://api.github.com/users/yjbanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yjbanov/subscriptions","organizations_url":"https://api.github.com/users/yjbanov/orgs","repos_url":"https://api.github.com/users/yjbanov/repos","events_url":"https://api.github.com/users/yjbanov/events{/privacy}","received_events_url":"https://api.github.com/users/yjbanov/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T20:54:00Z","updated_at":"2015-03-27T20:54:00Z","body":"What if we also support importing HTML into the template, e.g.:\r\n\r\nbutton.html:\r\n```\r\n<style>@import \"button.css\"</style>\r\n@import \"button_common.html\"\r\n```\r\n\r\nbutton_flat.html:\r\n```\r\n<style>@import \"button_flat.css\"</style>\r\n@import \"button_common.html\"\r\n```\r\n"}}