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
export default class CustomElement extends HTMLElement { | |
constructor() { | |
super() | |
this.$shadow = this.attachShadow() | |
this.$shadow.innerHTML = this.render() | |
} | |
connectedCallback() {} | |
disconnectedCallback() {} |
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
app.notify = (function() { | |
// Determine the correct object to use | |
var notification = window.Notification || window.mozNotification || window.webkitNotification || false | |
, permission = false | |
, note; | |
function init() { | |
notification && notification.requestPermission(permissionSuccess); | |
} |
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
var els = document.querySelectorAll('.vh-fix') | |
if (!els.length) return | |
for (var i = 0; i < els.length; i++) { | |
var el = els[i] | |
if (el.nodeName === 'IMG') { | |
el.onload = function() { | |
this.style.height = this.clientHeight + 'px' | |
} | |
} else { |
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
div { | |
background: conic-gradient(at top right, deeppink, rebeccapurple); | |
} |
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
/* | |
Pure CSS3 Accordion System inspired by the CSS Ninja | |
*/ | |
body{ font-family:sans-serif; background:#f9f9f9; } | |
dl { | |
padding: 10px; | |
} |
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
/* HSL's 50% lightness */ | |
/* middle grey */ | |
hsl(0 0% 50%) | |
lab(53.39% 0 -0.01) | |
/* 3.94:1 ❌ */ | |
/* lime */ | |
hsl(100 100% 50%) | |
lab(88.66% -77.99 84.31) |
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
main { | |
/* writing mode contextual shorthand for border-top and border-bottom respectively */ | |
border-block: 1px solid hotpink; | |
/* writing mode contextual shorthand for border-left and border-right respectively */ | |
border-inline: 1px solid hotpink; | |
} |
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
foo { | |
color: hsl(100,80%,75%); | |
background-color: hsl(100,20%,25%); | |
} | |
foo.map(styles => ({ | |
...styles, | |
color: 'hsl(100,80%,75%)', | |
background-color: 'hsl(100,20%,25%)', | |
})) |
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
const sugar = { | |
on: function(names, fn) { | |
names | |
.split(' ') | |
.forEach(name => | |
this.addEventListener(name, fn)) | |
}, | |
setAttributes: function(attrs) { | |
Object.entries(attrs) | |
.forEach(([key, val]) => |