This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Will only render the `content` or `render` elements if the tippy is mounted to the DOM. | |
// Replace <Tippy /> with <LazyTippy /> component and it should work the same. | |
const LazyTippy = forwardRef((props, ref) => { | |
const [mounted, setMounted] = useState(false); | |
const lazyPlugin = { | |
fn: () => ({ | |
onMount: () => setMounted(true), | |
onHidden: () => setMounted(false), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { h, app } from "hyperapp" | |
import tippy from "tippy.js" | |
export default (realProps, [reference]) => { | |
const props = { ...realProps } | |
if (props.html.constructor === Object && !props.target) { | |
const container = document.createElement('div') | |
app({}, {}, props.html, container) | |
props.html = container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* A small utility to fix the letter kerning on macOS Chrome and Firefox when using the system font | |
* (San Francisco). It is now fixed in the text rendering engine in FF 58 and Chrome 64. | |
* UPDATE: It appears the applied fix doesn't work when the font is in italics. New fix has been added. | |
* Must be applied to all browsers for now. | |
*/ | |
;(() => { | |
const ua = navigator.userAgent | |
// macOS 10.11 (El Capitan) came with San Francisco. Previous versions used Helvetica |