Skip to content

Instantly share code, notes, and snippets.

View bkardell's full-sized avatar

Brian Kardell bkardell

View GitHub Profile
<div>
<common-button id="btn">Statu</common-button>
<common-badge icon="favorite" for="btn" label="favorite icon"></common-badge>
</div>
@bkardell
bkardell / pset.html
Last active July 8, 2016 17:26
discussing the the markup of a panel (prollyfill with no shadow dom)
<common-panel-set role="tablist">
<!-- in a panelset we also generate this 'proxy container' which contains a copy of the panel headers.
we can then just use a simple CSS rule to hide either the inline headers (used for cases like accordions)
or the proxy headers (used for cases like tabs). This allows us to achieve many possible layouts.
After the proxy headers are just individual panels. The only difference from
regular panels is that the 'header' roles become tab and aria-selected is managed, and the content
becomes the tabpanel role.
-->
<div class="common-panel-tabs" role="presentation">
@bkardell
bkardell / expandable.html
Created July 8, 2016 16:47
discussing the the markup of a panel (prollyfill with no shadow dom)
<!-- the common panel element stays in the tree, it gains a role="region"
attribute and, if it wasn't specified, an expansion-state which can be used
for styling purposes
-->
<common-panel expansion-state="opened" role="region">
<!-- a header box and header with role="presentation" are added for styling purposes -->
<div class="common-panel-header-box" role="presentation" id="-cp-8">
<div class="common-panel-header" role="presentation">
<script>
var channel = new MessageChannel(),
mySwPort = channel.port1,
// port 2 plays in at another time... I think not needed rn
promises = [new Promise(function (resolve, reject) {
mySwPort.start();
mySwPort.addEventListener('message', function (message) {
console.log('resolving mySwPort %o', message);
resolve({});
})
/* jshint ignore:start */
(function() {
var addSheet = function (source) {
var sheet = document.createElement('style');
sheet.type = 'text/css';
sheet.innerHTML = source;
document.head.insertBefore(sheet, document.head.firstElementChild);
},
GLOBAL_STRINGS = {
'PLAY': 'Play',
@bkardell
bkardell / first.html
Created May 28, 2016 18:16
The first 'surviving' HTML from CERN (as per https://www.w3.org/2012/08/history-of-the-web/origins.htm) only hosted somewhere
<h1>Standardisation</h1>
There was not a lot of discussion of this at <a href=Introduction.html>ECHT90</a>, but there seem to be two leads:
<ol>
<li><a href=People.html#newcombe>Steve newcombe's</a> and Goldfarber's "Hytime" committee
looking into SGML, and
<li>An ISO working group known as MHEG, "Multimedia/HyperText Expert Group".
led by one Francis Kretz (Thompsa SA? Rennes?).
</lo>

If you work with the Web, chances are pretty good that you have a love hate relationship with it. Have you ever felt overwhelmed by the growing number of things that you don't know? Confused by the state of what you can use where? Ever experienced frustration with how something doesn't work quite as you'd hoped, or seemed unnecessarily confusing? Ever felt dismay at our seeming inability to get a standard for something that you find yourself needing all the time? If so, this meetup is for you.

A few years ago, The Extensible Web Manifesto began a movement in Web standards that has become a core underlying principle driving efforts at the W3C, ECMA and WhatWG. Now we're beginning an effort to correct the incentives and imbalances and make all of these problems a little better for folks like you and me. Come, listen to what's happening and join the discussion about how, together, we can do better.

If you work with the Web, chances are pretty good that you have a love hate relationship with it. Have you ever felt experienced frustration, fatique

<!doctype html>
<html>
<head>
<title>Hitch Demo</title>
<meta charset="utf-8">
<script src="https://hitchjs.com/dist/hitch-0.6.3.js"></script>
<style type="text/css" data-hitch-interpret>
@-hitch-requires https://www.hitchjs.com/use/bkardell.math/1;
.car:-math-lessthan(data-price, 200000){
@bkardell
bkardell / tokenListFor
Last active March 21, 2016 19:49
Rewind like 5 years no one was thinking much about a11y, developers I mean but developers were doing a lot of js on the dom dom has a simple API - hasAttribute, getAttribute, setAttribute and it has this one very special attribute 'class' which is a space delimited series so that was a big pain in the ass if you want to say 'does it have this cl…
HTMLElement.prototype._tokenListFor = function(attr) {
var el = this,
getTokens = function() {
return (el.hasAttribute(attr)) ? el.getAttribute(attr).split(' ') : [];
},
tokList = {
contains: function(token) {
var contains = getTokens().some(function(item) {
return item === token;
});