Skip to content

Instantly share code, notes, and snippets.

View geoffp's full-sized avatar

Geoff Pursell geoffp

View GitHub Profile
@getflourish
getflourish / Import CustomElements from .html files.md
Last active June 23, 2024 15:01
Import CustomElements from .html files

Import CustomElements from .html files

This is the technical implementation of the idea and concept described in my article “Why don’t we use HTML to author web components?

Instead of using template literals, constructors and other specifics to define CustomElements, this is a proposal to just use standard HTML to define CustomElements.

The goal is to import CustomElements like this:

Highcharts.Chart.prototype.callbacks.push(function(chart) {
var hasTouch = document.documentElement.ontouchstart !== undefined,
mouseTracker = chart.pointer,
container = chart.container,
mouseMove;
mouseMove = function (e) {
if (hasTouch) {
if (e && e.touches && e.touches.length > 1) {
mouseTracker.onContainerTouchMove(e);