{"action":"created","issue":{"url":"https://api.github.com/repos/svg/svgo/issues/447","labels_url":"https://api.github.com/repos/svg/svgo/issues/447/labels{/name}","comments_url":"https://api.github.com/repos/svg/svgo/issues/447/comments","events_url":"https://api.github.com/repos/svg/svgo/issues/447/events","html_url":"https://github.com/svg/svgo/pull/447","id":113944968,"number":447,"title":"Add localStyles plugin, tests and dependencies.","user":{"login":"strarsis","id":9271436,"avatar_url":"https://avatars.githubusercontent.com/u/9271436?v=3","gravatar_id":"","url":"https://api.github.com/users/strarsis","html_url":"https://github.com/strarsis","followers_url":"https://api.github.com/users/strarsis/followers","following_url":"https://api.github.com/users/strarsis/following{/other_user}","gists_url":"https://api.github.com/users/strarsis/gists{/gist_id}","starred_url":"https://api.github.com/users/strarsis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strarsis/subscriptions","organizations_url":"https://api.github.com/users/strarsis/orgs","repos_url":"https://api.github.com/users/strarsis/repos","events_url":"https://api.github.com/users/strarsis/events{/privacy}","received_events_url":"https://api.github.com/users/strarsis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-28T23:08:53Z","updated_at":"2015-10-29T15:52:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/svg/svgo/pulls/447","html_url":"https://github.com/svg/svgo/pull/447","diff_url":"https://github.com/svg/svgo/pull/447.diff","patch_url":"https://github.com/svg/svgo/pull/447.patch"},"body":"This PR adds the localStyles plugin which copies styles from style element to style attribute of the selected elements.\r\n\r\n- run this plugin before the removeStyleElement plugin\r\n- this plugin won't remove the style element, use removeStyleElement after this plugin\r\n- run convertStyleToAttrs after this plugin\r\n- minify styles in style element if necessary before this plugin (minified = \"computed\" styles)\r\n- this plugin currently works only with class and id selectors, advanced css selectors (e.g. :nth-child) aren't currently supported\r\n- inline styles will be written after the styles from style element\r\n- classes are inlined by the order of their names in class element attribute"},"comment":{"url":"https://api.github.com/repos/svg/svgo/issues/comments/152222839","html_url":"https://github.com/svg/svgo/pull/447#issuecomment-152222839","issue_url":"https://api.github.com/repos/svg/svgo/issues/447","id":152222839,"user":{"login":"Joeynoh","id":198937,"avatar_url":"https://avatars.githubusercontent.com/u/198937?v=3","gravatar_id":"","url":"https://api.github.com/users/Joeynoh","html_url":"https://github.com/Joeynoh","followers_url":"https://api.github.com/users/Joeynoh/followers","following_url":"https://api.github.com/users/Joeynoh/following{/other_user}","gists_url":"https://api.github.com/users/Joeynoh/gists{/gist_id}","starred_url":"https://api.github.com/users/Joeynoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joeynoh/subscriptions","organizations_url":"https://api.github.com/users/Joeynoh/orgs","repos_url":"https://api.github.com/users/Joeynoh/repos","events_url":"https://api.github.com/users/Joeynoh/events{/privacy}","received_events_url":"https://api.github.com/users/Joeynoh/received_events","type":"User","site_admin":false},"created_at":"2015-10-29T15:52:23Z","updated_at":"2015-10-29T15:52:23Z","body":"Just my two cents: It makes sense that this plugin does not remove the style element, considering there is already a plugin that does. You can simply run them in sequence. Optionally, this plugin can perhaps call removeStyleElement, but should be set to false by default.\r\n\r\nCalling cleanupAttrs afterwards makes sense as well."}}