-
Notifications
You must be signed in to change notification settings - Fork 1
/
tooltip.html
49 lines (40 loc) · 8.15 KB
/
tooltip.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
<link rel="import" href="_loader.html" />
</head>
<body>
<template>
<style type="text/css">/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;line-height:1.5;color:#24292e;background-color:#fff}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}summary{display:list-item}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress,sub,sup{vertical-align:baseline}[hidden],template{display:none}a{background-color:transparent;-webkit-text-decoration-skip:objects;color:#0366d6;text-decoration:none}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline dotted}b,strong{font-weight:600}dfn{font-style:italic}h1{margin:.67em 0}mark{background-color:#ff0;color:#000}small{font-size:90%}sub,sup{font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}svg:not(:root){overflow:hidden}kbd,samp{font-family:monospace,monospace;font-size:1em}figure{margin:1em 40px}hr{box-sizing:content-box}button,input,select,textarea{font:inherit;margin:0}optgroup{font-weight:700}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{color:inherit;display:table;max-width:100%;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio],legend{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit;opacity:.54}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}*{box-sizing:border-box}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a:hover{text-decoration:underline}.rule,hr{height:0;margin:15px 0;overflow:hidden;background:0 0;border:0;border-bottom:1px solid #dfe2e5}.rule::after,.rule::before,hr::after,hr::before{display:table;content:""}.rule::after,hr::after{clear:both}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}button{cursor:pointer}h1,h2,h3,h4,h5,h6,p{margin-top:0;margin-bottom:0}h1,h2,h3,h4,h5,h6{font-size:32px;font-weight:600}h2,h3,h4,h5,h6{font-size:24px}h3,h4,h5,h6{font-size:20px}h4,h5,h6{font-size:16px}h5,h6{font-size:14px}h6{font-size:12px}p{margin-bottom:10px}blockquote{margin:0}ol,ul{padding-left:0}ol ol,ul ol{list-style-type:lower-roman}ol ol ol,ol ul ol,ul ol ol,ul ul ol{list-style-type:lower-alpha}dd{margin-left:0}code,pre,tt{font-family:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px}ol,pre,ul{margin-top:0;margin-bottom:0}.octicon{vertical-align:text-bottom}</style>
<style type="text/css">@keyframes tooltip-appear{0%{opacity:0}to{opacity:1}}.tooltipped{position:relative}.tooltipped::after,.tooltipped::before{position:absolute;display:none;pointer-events:none;opacity:0}.tooltipped::after{padding:5px 8px;font:11px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";-webkit-font-smoothing:subpixel-antialiased;color:#fff;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-wrap:break-word;white-space:pre;content:attr(aria-label);background:rgba(27,31,35,.8);border-radius:3px;z-index:1000000}.tooltipped::before{z-index:1000001;width:0;height:0;color:rgba(27,31,35,.8);content:"";border:5px solid transparent}.tooltipped:active::after,.tooltipped:active::before,.tooltipped:focus::after,.tooltipped:focus::before,.tooltipped:hover::after,.tooltipped:hover::before{display:inline-block;text-decoration:none;animation-name:tooltip-appear;animation-duration:.1s;animation-fill-mode:forwards;animation-timing-function:ease-in;animation-delay:.4s}.tooltipped-no-delay:active::after,.tooltipped-no-delay:active::before,.tooltipped-no-delay:focus::after,.tooltipped-no-delay:focus::before,.tooltipped-no-delay:hover::after,.tooltipped-no-delay:hover::before{opacity:1;animation:none}.tooltipped-multiline:active::after,.tooltipped-multiline:focus::after,.tooltipped-multiline:hover::after{display:table-cell}.tooltipped-s::after{right:50%}.tooltipped-s::after,.tooltipped-se::after,.tooltipped-sw::after{top:100%;margin-top:5px}.tooltipped-sw::after{right:50%}.tooltipped-s::before,.tooltipped-se::before,.tooltipped-sw::before{top:auto;right:50%;bottom:-5px;margin-right:-5px;border-bottom-color:rgba(27,31,35,.8)}.tooltipped-se::after{right:auto;left:50%;margin-left:-15px}.tooltipped-sw::after{margin-right:-15px}.tooltipped-n::after{right:50%}.tooltipped-n::after,.tooltipped-ne::after,.tooltipped-nw::after{bottom:100%;margin-bottom:5px}.tooltipped-nw::after{right:50%}.tooltipped-n::before,.tooltipped-ne::before,.tooltipped-nw::before{top:-5px;right:50%;bottom:auto;margin-right:-5px;border-top-color:rgba(27,31,35,.8)}.tooltipped-ne::after{right:auto;left:50%;margin-left:-15px}.tooltipped-nw::after{margin-right:-15px}.tooltipped-n::after,.tooltipped-s::after{transform:translateX(50%)}.tooltipped-w::after{right:100%;bottom:50%;margin-right:5px;transform:translateY(50%)}.tooltipped-w::before{top:50%;bottom:50%;left:-5px;margin-top:-5px;border-left-color:rgba(27,31,35,.8)}.tooltipped-e::after{bottom:50%;left:100%;margin-left:5px;transform:translateY(50%)}.tooltipped-e::before{top:50%;right:-5px;bottom:50%;margin-top:-5px;border-right-color:rgba(27,31,35,.8)}.tooltipped-multiline::after{width:max-content;max-width:250px;word-wrap:break-word;white-space:pre-line;border-collapse:separate}.tooltipped-multiline.tooltipped-n::after,.tooltipped-multiline.tooltipped-s::after{right:auto;left:50%;transform:translateX(-50%)}.tooltipped-multiline.tooltipped-e::after,.tooltipped-multiline.tooltipped-w::after{right:100%}@media screen and (min-width:0\0){.tooltipped-multiline::after{width:250px}}.tooltipped-sticky::after,.tooltipped-sticky::before{display:inline-block}.tooltipped-sticky.tooltipped-multiline::after{display:table-cell}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min--moz-device-pixel-ratio:2),only screen and (-moz-min-device-pixel-ratio:2),only screen and (-o-min-device-pixel-ratio:2/1),only screen and (min-device-pixel-ratio:2),only screen and (min-resolution:192dpi),only screen and (min-resolution:2dppx){.tooltipped-w::after{margin-right:4.5px}}</style>
</template>
<script>
(function() {
githubPrimer.registerElement('primer-tooltip', {
create: function (ownerDocument, document) {
var content = Array.from(this.childNodes);
var label = this.hasAttribute('aria-label') ? this.getAttribute('aria-label') : '';
var tooltipDirection = this.hasAttribute('direction') ? this.getAttribute('direction') : null;
var tooltipNodelay = this.hasAttribute('no-delay');
var shadowRoot = this.attachShadow({ mode: 'open' });
content.forEach(child => {
if (child instanceof HTMLElement) {
child.classList.add('tooltipped');
if (tooltipDirection !== null) {
child.classList.add('tooltipped-' + tooltipDirection);
}
if (tooltipNodelay) {
child.classList.add('tooltipped-no-delay');
}
child.setAttribute('aria-label', label);
}
shadowRoot.appendChild(child);
});
return shadowRoot;
}
});
})();
</script>
</body>
</html>