{"action":"created","issue":{"url":"https://api.github.com/repos/aurelia/framework/issues/50","labels_url":"https://api.github.com/repos/aurelia/framework/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/framework/issues/50/comments","events_url":"https://api.github.com/repos/aurelia/framework/issues/50/events","html_url":"https://github.com/aurelia/framework/issues/50","id":58238247,"number":50,"title":"stylesheets as first class citizens","user":{"login":"Aaike","id":378772,"avatar_url":"https://avatars.githubusercontent.com/u/378772?v=3","gravatar_id":"","url":"https://api.github.com/users/Aaike","html_url":"https://github.com/Aaike","followers_url":"https://api.github.com/users/Aaike/followers","following_url":"https://api.github.com/users/Aaike/following{/other_user}","gists_url":"https://api.github.com/users/Aaike/gists{/gist_id}","starred_url":"https://api.github.com/users/Aaike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aaike/subscriptions","organizations_url":"https://api.github.com/users/Aaike/orgs","repos_url":"https://api.github.com/users/Aaike/repos","events_url":"https://api.github.com/users/Aaike/events{/privacy}","received_events_url":"https://api.github.com/users/Aaike/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-02-19T17:12:49Z","updated_at":"2015-03-30T05:16:14Z","closed_at":null,"body":"I would like to see the ability to load and unload stylesheets per view model, treat them with the same importance as html files using a `.withStyle()` function much like the `.withView()` function.\r\nThe same convention can be used as for the other files by placing the css file right next to the js and html files for each view.\r\nI suppose the same can be done with custom elements and behaviours.\r\n\r\nWe can currently already do this by using an import statement in each view model\r\n`import 'path/to/style.css!'`\r\nBut using a `.withStyle()` function would allow us to choose wich style should be used based on some code or some configuration settings (theme/skin based).\r\nAnd by using the import statement it is not easy to then unload that css when the view is destroyed.\r\n\r\nWould also be great if the `withStyle()` can accept files that need to be precompiled, and perhaps takes care of the compilation in the background."},"comment":{"url":"https://api.github.com/repos/aurelia/framework/issues/comments/87549972","html_url":"https://github.com/aurelia/framework/issues/50#issuecomment-87549972","issue_url":"https://api.github.com/repos/aurelia/framework/issues/50","id":87549972,"user":{"login":"smolinari","id":3314957,"avatar_url":"https://avatars.githubusercontent.com/u/3314957?v=3","gravatar_id":"","url":"https://api.github.com/users/smolinari","html_url":"https://github.com/smolinari","followers_url":"https://api.github.com/users/smolinari/followers","following_url":"https://api.github.com/users/smolinari/following{/other_user}","gists_url":"https://api.github.com/users/smolinari/gists{/gist_id}","starred_url":"https://api.github.com/users/smolinari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smolinari/subscriptions","organizations_url":"https://api.github.com/users/smolinari/orgs","repos_url":"https://api.github.com/users/smolinari/repos","events_url":"https://api.github.com/users/smolinari/events{/privacy}","received_events_url":"https://api.github.com/users/smolinari/received_events","type":"User","site_admin":false},"created_at":"2015-03-30T05:16:14Z","updated_at":"2015-03-30T05:16:14Z","body":"I've been lurking this project and I am nobody special, but I'd also welcome anything that helps do what @Zoltu suggests. \r\n\r\n> As a developer who tends to work on very large applications, the ability to build widgets/components that work in isolation is critical, and in fact the number one thing I am looking for in a framework.\r\n\r\nOur project is also going to build off of a widget/ component basis and as a platform we want users of the platform to be able exchange components amongst themselves. The isolation part means to us that the users can insert their own content, yet import the proper styles needed for the component to render properly, so it is styled to their own pages, but without seriously breaking the page. So actually being able to import style sheets would be a killer feature. Though, I have to agree, it does sound more like a plug-in kind of feature, and if it can be done with Aurelia easily as a plug-in, great.:)\r\n\r\nScott"}}