{"action":"created","issue":{"url":"https://api.github.com/repos/pcfreak30/wp-criticalcss/issues/5","repository_url":"https://api.github.com/repos/pcfreak30/wp-criticalcss","labels_url":"https://api.github.com/repos/pcfreak30/wp-criticalcss/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/pcfreak30/wp-criticalcss/issues/5/comments","events_url":"https://api.github.com/repos/pcfreak30/wp-criticalcss/issues/5/events","html_url":"https://github.com/pcfreak30/wp-criticalcss/issues/5","id":222954201,"number":5,"title":"Feature request: Force include (missing) styles","user":{"login":"pocketjoso","id":7192832,"avatar_url":"https://avatars1.githubusercontent.com/u/7192832?v=4","gravatar_id":"","url":"https://api.github.com/users/pocketjoso","html_url":"https://github.com/pocketjoso","followers_url":"https://api.github.com/users/pocketjoso/followers","following_url":"https://api.github.com/users/pocketjoso/following{/other_user}","gists_url":"https://api.github.com/users/pocketjoso/gists{/gist_id}","starred_url":"https://api.github.com/users/pocketjoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pocketjoso/subscriptions","organizations_url":"https://api.github.com/users/pocketjoso/orgs","repos_url":"https://api.github.com/users/pocketjoso/repos","events_url":"https://api.github.com/users/pocketjoso/events{/privacy}","received_events_url":"https://api.github.com/users/pocketjoso/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-04-20T05:34:30Z","updated_at":"2017-08-15T14:02:45Z","closed_at":null,"body":"I suggest to add a ~ `forceIncludeCssSelectors` option in the plugin, visible in the UI, to allow the user to enter strings or regexes to match css selectors, for which the criticalcss.com API will keep their styles in the critical css no matter what:\r\n```js\r\nforceIncludeCssSelectors: [\r\n      '.keepMeEvenIfNotSeenOrNotDeemedCritical',\r\n      /^\\.regexWorksToo/\r\n]\r\n```\r\n\r\nThe use case for this is when the HTML (some part of it) is setup in a way that doesn't work for the critical css generation and it is not feasible to change it. For example, elements appearing early in the DOM but using absolute positioning to \"hide\" themselves outside of the critical viewport will not be considered critical by criticalcss.com, and the styles for the hiding will thus be missing. In this case the developer could force include the \"hiding\" styles for the element."},"comment":{"url":"https://api.github.com/repos/pcfreak30/wp-criticalcss/issues/comments/322474969","html_url":"https://github.com/pcfreak30/wp-criticalcss/issues/5#issuecomment-322474969","issue_url":"https://api.github.com/repos/pcfreak30/wp-criticalcss/issues/5","id":322474969,"user":{"login":"pocketjoso","id":7192832,"avatar_url":"https://avatars1.githubusercontent.com/u/7192832?v=4","gravatar_id":"","url":"https://api.github.com/users/pocketjoso","html_url":"https://github.com/pocketjoso","followers_url":"https://api.github.com/users/pocketjoso/followers","following_url":"https://api.github.com/users/pocketjoso/following{/other_user}","gists_url":"https://api.github.com/users/pocketjoso/gists{/gist_id}","starred_url":"https://api.github.com/users/pocketjoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pocketjoso/subscriptions","organizations_url":"https://api.github.com/users/pocketjoso/orgs","repos_url":"https://api.github.com/users/pocketjoso/repos","events_url":"https://api.github.com/users/pocketjoso/events{/privacy}","received_events_url":"https://api.github.com/users/pocketjoso/received_events","type":"User","site_admin":false},"created_at":"2017-08-15T14:02:45Z","updated_at":"2017-08-15T14:02:45Z","body":"never thought about case insensitive - it's the only flag that makes sense for `forceInclude`.\r\n\r\nI'll make this change, but note that this will be a breaking change (since it's not in use yet) - so you will no longer be able to pass just `#footer`, instead `value` will now have to be a valid (js) regex. Note as well that any `\\` needs to be escaped inside your JSON payload, which you might or might not get automatically, depending on whether you will be operating on pure strings, or regexes.\r\n\r\nSo yes, final api will be:\r\n```JSON\r\n{\"type\": \"RegExp\", \"value\": \"/#footer/i\"}\r\n```"}}
{"actor":{"display_login":"pocketjoso"}}