{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/juice/issues/187","repository_url":"https://api.github.com/repos/Automattic/juice","labels_url":"https://api.github.com/repos/Automattic/juice/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/juice/issues/187/comments","events_url":"https://api.github.com/repos/Automattic/juice/issues/187/events","html_url":"https://github.com/Automattic/juice/issues/187","id":121980486,"number":187,"title":"On synchronous use and filtering styles","user":{"login":"dantman","id":53399,"avatar_url":"https://avatars.githubusercontent.com/u/53399?v=3","gravatar_id":"","url":"https://api.github.com/users/dantman","html_url":"https://github.com/dantman","followers_url":"https://api.github.com/users/dantman/followers","following_url":"https://api.github.com/users/dantman/following{/other_user}","gists_url":"https://api.github.com/users/dantman/gists{/gist_id}","starred_url":"https://api.github.com/users/dantman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantman/subscriptions","organizations_url":"https://api.github.com/users/dantman/orgs","repos_url":"https://api.github.com/users/dantman/repos","events_url":"https://api.github.com/users/dantman/events{/privacy}","received_events_url":"https://api.github.com/users/dantman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2015-12-14T06:07:48Z","updated_at":"2016-09-08T00:56:28Z","closed_at":"2016-09-08T00:56:28Z","body":"One feature I've considered trying to embed in juice is the ability to filter and replace some of the style tags. For example taking all `<style type=\"text/less\">` tags, compiling them with less, and updating the content and type of the tag. Or filtering css through PostCSS.\r\n\r\nInitially I thought it would be as simple as a patch [like this](https://gist.github.com/dantman/7fa1338486b3f892b6de). Which should work. But only for synchronous things, which is a problem since some notable css transpilers like less are async.\r\n\r\nThis brought up some more issues/points that merit discussion:\r\n\r\n* In some situations like an `@import` in LESS that was included through a `<link>` rather than an inline `<style>` tag the transpiler should know the original filename. This can be fixed either with another internal `data-` tag or by doing the filtering in web-resource-inliner (however the latter would mean filters cannot be applied to `<style>` tags, implementation would also be messier).\r\n* Is there still value in keeping the sync/async hybrid approach in juice if it makes the internal code more complex?\r\n* Rather than a styleFilter function, perhaps a plugin archatecture similar to what babel, broserify, and other packages have would be better. So pulgins can be written for things like less and sass.\r\n\r\nThoughts?\r\n"},"comment":{"url":"https://api.github.com/repos/Automattic/juice/issues/comments/245464105","html_url":"https://github.com/Automattic/juice/issues/187#issuecomment-245464105","issue_url":"https://api.github.com/repos/Automattic/juice/issues/187","id":245464105,"user":{"login":"jrit","id":1255823,"avatar_url":"https://avatars.githubusercontent.com/u/1255823?v=3","gravatar_id":"","url":"https://api.github.com/users/jrit","html_url":"https://github.com/jrit","followers_url":"https://api.github.com/users/jrit/followers","following_url":"https://api.github.com/users/jrit/following{/other_user}","gists_url":"https://api.github.com/users/jrit/gists{/gist_id}","starred_url":"https://api.github.com/users/jrit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrit/subscriptions","organizations_url":"https://api.github.com/users/jrit/orgs","repos_url":"https://api.github.com/users/jrit/repos","events_url":"https://api.github.com/users/jrit/events{/privacy}","received_events_url":"https://api.github.com/users/jrit/received_events","type":"User","site_admin":false},"created_at":"2016-09-08T00:56:28Z","updated_at":"2016-09-08T00:56:28Z","body":"WRI has a linkTransform and scriptTransform on it now, which should be able to handle transforming LESS files and other such things. Hope that is enough to close this without really missing anything."}}
{"actor":{"display_login":"jrit"}}