{"action":"created","issue":{"url":"https://api.github.com/repos/oddbird/accoutrement/issues/12","repository_url":"https://api.github.com/repos/oddbird/accoutrement","labels_url":"https://api.github.com/repos/oddbird/accoutrement/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/oddbird/accoutrement/issues/12/comments","events_url":"https://api.github.com/repos/oddbird/accoutrement/issues/12/events","html_url":"https://github.com/oddbird/accoutrement/issues/12","id":356040950,"node_id":"MDU6SXNzdWUzNTYwNDA5NTA=","number":12,"title":"Automatically traversing nested maps","user":{"login":"joelschou","id":1060506,"node_id":"MDQ6VXNlcjEwNjA1MDY=","avatar_url":"https://avatars2.githubusercontent.com/u/1060506?v=4","gravatar_id":"","url":"https://api.github.com/users/joelschou","html_url":"https://github.com/joelschou","followers_url":"https://api.github.com/users/joelschou/followers","following_url":"https://api.github.com/users/joelschou/following{/other_user}","gists_url":"https://api.github.com/users/joelschou/gists{/gist_id}","starred_url":"https://api.github.com/users/joelschou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelschou/subscriptions","organizations_url":"https://api.github.com/users/joelschou/orgs","repos_url":"https://api.github.com/users/joelschou/repos","events_url":"https://api.github.com/users/joelschou/events{/privacy}","received_events_url":"https://api.github.com/users/joelschou/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-31T16:09:09Z","updated_at":"2018-08-31T16:35:20Z","closed_at":null,"author_association":"NONE","body":"In your **QuickStart: Core** documentation, you have this example for internal references in nested maps:\r\n\r\n> Nested maps will compare **#tags** internally, before looking at the parent keys:\r\n> \r\n> ```scss\r\n> $map: (\r\n>   'root': 16px,\r\n>   'large-screen': (\r\n>     'root': 24px,\r\n> \r\n>     // 'alias' == 24px\r\n>     'alias': '#root'\r\n>   ),\r\n> );\r\n> ```\r\n\r\nWhich is cool! However, what I can't figure out is if there's a way to access `alias` with a single command without resorting to nested `get-token()`s.\r\n```scss\r\nget-token( $map, 'alias' );\r\n// alias 👎 \r\nget-token( $map, 'large-screen' );\r\n// (\"root\": 24px, \"alias\": 24px) 👎 \r\nget-token( get-token( $map, 'large-screen' ), 'alias' );\r\n// 24px 👍 \r\n```\r\n\r\nIt would be really cool to be able to do something like this, whether it's a `.`, `:`, `>`, `->` or whatever:\r\n```scss\r\nget-token( $map, 'large-screen.alias' )\r\n// 24px 👍 \r\n```\r\n\r\nIf there _is_ a way to do that and I just can't find it, please do share. Thanks!"},"comment":{"url":"https://api.github.com/repos/oddbird/accoutrement/issues/comments/417720211","html_url":"https://github.com/oddbird/accoutrement/issues/12#issuecomment-417720211","issue_url":"https://api.github.com/repos/oddbird/accoutrement/issues/12","id":417720211,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzcyMDIxMQ==","user":{"login":"mirisuzanne","id":104161,"node_id":"MDQ6VXNlcjEwNDE2MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/104161?v=4","gravatar_id":"","url":"https://api.github.com/users/mirisuzanne","html_url":"https://github.com/mirisuzanne","followers_url":"https://api.github.com/users/mirisuzanne/followers","following_url":"https://api.github.com/users/mirisuzanne/following{/other_user}","gists_url":"https://api.github.com/users/mirisuzanne/gists{/gist_id}","starred_url":"https://api.github.com/users/mirisuzanne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirisuzanne/subscriptions","organizations_url":"https://api.github.com/users/mirisuzanne/orgs","repos_url":"https://api.github.com/users/mirisuzanne/repos","events_url":"https://api.github.com/users/mirisuzanne/events{/privacy}","received_events_url":"https://api.github.com/users/mirisuzanne/received_events","type":"User","site_admin":false},"created_at":"2018-08-31T16:35:20Z","updated_at":"2018-08-31T16:35:20Z","author_association":"MEMBER","body":"We don't have that feature currently, no. The nested-map support that we built is specifically to handle aliases inside adjustment-maps. I'd consider adding that feature, but I generally do this with multiple maps:\r\n\r\n```scss\r\n$small-screen: (\r\n  'root': 16px,\r\n);\r\n\r\n$large-screen: (\r\n  'root': 24px,\r\n  'alias': '#root',\r\n);\r\n\r\nget-token( $large-screen, 'alias' ); // 24px\r\n```\r\n\r\nAlso, if you have 'alias' based on 'root', and change 'root' at some point, 'alias' will update:\r\n\r\n```scss\r\n$small-screen: (\r\n  'root': 16px,\r\n  'alias': '#root',\r\n);\r\n\r\n$large-screen: map-merge($small-screen, ('root': 24px));\r\n\r\nget-token( $large-screen, 'alias' ); // 24px\r\n```\r\n\r\nOr you could write a function that accepts a list of keys, and finds them in order… I haven't tested, but something like this:\r\n\r\n```scss\r\n@function get-nested(\r\n  $map,\r\n  $keys...\r\n){\r\n  @each $key in $keys {\r\n    $map: token-get($map, $key);\r\n  }\r\n\r\n  @return $map;\r\n}\r\n```"}}
{"actor":{"display_login":"mirisuzanne"}}