Skip to content

Instantly share code, notes, and snippets.

View jonmann20's full-sized avatar

Jon Wiedmann jonmann20

View GitHub Profile
@jonmann20
jonmann20 / i-con.js
Last active February 14, 2019 21:09
Custom icon element
import {html, LitElement} from 'lit-element';
const icons = {
code: 'M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z',
home: 'M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z',
mail: 'M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z',
menu: 'M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z',
polymer: 'M19 4h-4L7.11 16.63 4.5 12 9 4H5L.5 12 5 20h4l7.89-12.63L19.5 12 15 20h4l4.5-8z'
};
@jonmann20
jonmann20 / dedup-custom-elements.js
Created February 19, 2018 14:49
Dedup custom elements
let _define = customElements.define;
let registered = [];
customElements.define = function() {
const componentName = arguments[0];
if(registered.includes(componentName)) {
console.error(`Trying to register ${componentName} more than once`);
return;
}
@jonmann20
jonmann20 / chromeBug.html
Created September 15, 2014 18:50
Chrome Media Query Bug (15 Sept. 2014)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
div {
border: 1px solid; /* for visualization only */
display: inline-block;