Skip to content

Instantly share code, notes, and snippets.

@captainbrosset
Last active March 5, 2021 09:08
Show Gist options
  • Save captainbrosset/9642768d3a23c3c21c490cefc1f3db41 to your computer and use it in GitHub Desktop.
Save captainbrosset/9642768d3a23c3c21c490cefc1f3db41 to your computer and use it in GitHub Desktop.
Code snippets for the "How we built the DevTools Tooltips" article
{
// The ID of the area we're highlighting
"elements-panel": {
// Some information for the displayed content
"tooltip": {
"title": "...",
"description": "...",
},
// The list of DOM elements to wrap
"selectors": [
{
// Each element comes with a CSS selector so we can
// find it in the document.
"selector": '[aria-label="Elements"]',
// And optionally an offset to avoid gaps between elements.
"offsets": [{direction: Direction.Bottom, size: 2}]
},
{
"selector": '#elements-content'
},
{
"selector": '#elements-crumbs'
},
],
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment