{"action":"closed","number":1392,"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1392","id":53028642,"html_url":"https://github.com/Automattic/wp-calypso/pull/1392","diff_url":"https://github.com/Automattic/wp-calypso/pull/1392.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/1392.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/1392","number":1392,"state":"closed","locked":false,"title":"Framework: move z-index values to z-index scss function","user":{"login":"gwwar","id":1270189,"avatar_url":"https://avatars.githubusercontent.com/u/1270189?v=3","gravatar_id":"","url":"https://api.github.com/users/gwwar","html_url":"https://github.com/gwwar","followers_url":"https://api.github.com/users/gwwar/followers","following_url":"https://api.github.com/users/gwwar/following{/other_user}","gists_url":"https://api.github.com/users/gwwar/gists{/gist_id}","starred_url":"https://api.github.com/users/gwwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwwar/subscriptions","organizations_url":"https://api.github.com/users/gwwar/orgs","repos_url":"https://api.github.com/users/gwwar/repos","events_url":"https://api.github.com/users/gwwar/events{/privacy}","received_events_url":"https://api.github.com/users/gwwar/received_events","type":"User","site_admin":false},"body":"Fixes #1139. This PR tidies up our static z-index values, and makes it easy to check against our different stacking contexts.\r\n\r\nA future PR will address components like popover that need dynamically created z-indexes, because they are inserted into a variety of contexts.\r\n\r\nAlso see: [sass functions](http://thesassway.com/advanced/pure-sass-functions)\r\n\r\nBefore:\r\n```scss\r\n.environment-badge { \r\n    z-index: 999;\r\n}\r\n```\r\n\r\nAfter:\r\n```scss\r\n.environment-badge { \r\n    z-index: z-index( 'root', '.environment-badge' );\r\n}\r\n```\r\n\r\nWhen adding z-indexes use our scss z-index function. This means you'll need to add\r\nanother entry to the `$z-layers` variable in `assets/stylesheets/shared/functions/_z-index.scss`\r\n\r\nBecause browsers support a hierarchy of stacking contexts rather than a single global one, we use two keys: the name of the parent stacking context, and a unique name for the stacking context you've just created. We do this so we can quickly compare z-index values within a given stacking context. \r\n\r\nA stacking context is created when:\r\n\r\n1. It's the root element (HTML)\r\n2. Has a position other than static, with a z-index value\r\n3. position:fixed\r\n4. Has one of the following css properties: (transform, opacity<1, mix-blend-mode, filter)\r\n5. isolation:isolate\r\n6: -webkit-overflow-scrolling: touch\r\n\r\nSo, to add a new z-index:\r\n\r\n1. You'll want to make sure the element actually creates a stacking context\r\n2. Lookup what it's parent stacking context\r\n3. Put the new rule in the $z-layers tree, using the stacking context(s) as the initial key(s) and the element's full CSS selector as the final key.\r\n\r\nYou can run this handy [gist](https://gist.github.com/gwwar/2f661deec7b99a1a418b) in the console to find both.\r\n\r\n```scss\r\n$z-layers: (\r\n    'root': (\r\n        '.environment-badge': 999,\r\n        '.some-other-stacking-context': 10000\r\n    ),\r\n    '.environment-badge': (\r\n        '.environment-badge .environment::before': -1,\r\n        '.environment-badge .bug-report': 1000\r\n    )\r\n);\r\n```\r\n\r\n### Testing\r\n\r\nThe diff between style.css in this branch and in master should only contain the removal of a duplicate z-index value.\r\n","created_at":"2015-12-08T19:46:37Z","updated_at":"2015-12-12T16:33:18Z","closed_at":"2015-12-12T16:33:18Z","merged_at":"2015-12-12T16:33:18Z","merge_commit_sha":"7ce70936a6f3d1ed12fa9d0b7ad799e20267b87d","assignee":{"login":"gwwar","id":1270189,"avatar_url":"https://avatars.githubusercontent.com/u/1270189?v=3","gravatar_id":"","url":"https://api.github.com/users/gwwar","html_url":"https://github.com/gwwar","followers_url":"https://api.github.com/users/gwwar/followers","following_url":"https://api.github.com/users/gwwar/following{/other_user}","gists_url":"https://api.github.com/users/gwwar/gists{/gist_id}","starred_url":"https://api.github.com/users/gwwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwwar/subscriptions","organizations_url":"https://api.github.com/users/gwwar/orgs","repos_url":"https://api.github.com/users/gwwar/repos","events_url":"https://api.github.com/users/gwwar/events{/privacy}","received_events_url":"https://api.github.com/users/gwwar/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/20","html_url":"https://github.com/Automattic/wp-calypso/milestones/Core:%20Iteration%2017","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/20/labels","id":1420284,"number":20,"title":"Core: Iteration 17","description":"","creator":{"login":"hoverduck","id":7233112,"avatar_url":"https://avatars.githubusercontent.com/u/7233112?v=3","gravatar_id":"","url":"https://api.github.com/users/hoverduck","html_url":"https://github.com/hoverduck","followers_url":"https://api.github.com/users/hoverduck/followers","following_url":"https://api.github.com/users/hoverduck/following{/other_user}","gists_url":"https://api.github.com/users/hoverduck/gists{/gist_id}","starred_url":"https://api.github.com/users/hoverduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoverduck/subscriptions","organizations_url":"https://api.github.com/users/hoverduck/orgs","repos_url":"https://api.github.com/users/hoverduck/repos","events_url":"https://api.github.com/users/hoverduck/events{/privacy}","received_events_url":"https://api.github.com/users/hoverduck/received_events","type":"User","site_admin":false},"open_issues":35,"closed_issues":20,"state":"open","created_at":"2015-11-19T17:10:22Z","updated_at":"2015-12-12T16:33:18Z","due_on":"2015-12-31T06:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1392/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1392/comments","review_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/1392/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/bdf36c9d45793157282b402f277bda6d471d2694","head":{"label":"Automattic:add/z-index-map-1139","ref":"add/z-index-map-1139","sha":"bdf36c9d45793157282b402f277bda6d471d2694","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","created_at":"2015-11-10T20:00:16Z","updated_at":"2015-12-12T13:35:30Z","pushed_at":"2015-12-12T16:33:18Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":12537,"stargazers_count":6091,"watchers_count":6091,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":659,"mirror_url":null,"open_issues_count":849,"forks":659,"open_issues":849,"watchers":6091,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"3e8fa7f26277305dbb36ff6b3d54513f02fade61","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","created_at":"2015-11-10T20:00:16Z","updated_at":"2015-12-12T13:35:30Z","pushed_at":"2015-12-12T16:33:18Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":12537,"stargazers_count":6091,"watchers_count":6091,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":659,"mirror_url":null,"open_issues_count":849,"forks":659,"open_issues":849,"watchers":6091,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1392"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/1392"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/1392"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/1392/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1392/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/1392/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/bdf36c9d45793157282b402f277bda6d471d2694"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"gwwar","id":1270189,"avatar_url":"https://avatars.githubusercontent.com/u/1270189?v=3","gravatar_id":"","url":"https://api.github.com/users/gwwar","html_url":"https://github.com/gwwar","followers_url":"https://api.github.com/users/gwwar/followers","following_url":"https://api.github.com/users/gwwar/following{/other_user}","gists_url":"https://api.github.com/users/gwwar/gists{/gist_id}","starred_url":"https://api.github.com/users/gwwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwwar/subscriptions","organizations_url":"https://api.github.com/users/gwwar/orgs","repos_url":"https://api.github.com/users/gwwar/repos","events_url":"https://api.github.com/users/gwwar/events{/privacy}","received_events_url":"https://api.github.com/users/gwwar/received_events","type":"User","site_admin":false},"comments":18,"review_comments":3,"commits":1,"additions":474,"deletions":137,"changed_files":78}}