-
-
Save matatk/c2104358b3365366a5d4 to your computer and use it in GitHub Desktop.
Revisions
-
matatk renamed this gist
Jul 31, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
matatk revised this gist
Jul 31, 2014 . 1 changed file with 0 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -12,10 +12,6 @@ <p><strong>code:</strong></p> <pre><code><h>Ramones: Hey! Ho! Let's Go</h></code></pre> </div> <h>Heading text level 1</h> <section><h>Heading text level 2</h> <section><h>Heading text level 3</h> -
matatk revised this gist
Jul 31, 2014 . 1 changed file with 45 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,45 @@ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>h Demo</title> <script src="h.js"></script> <link rel="stylesheet" href="h.css"> </head> <body unresolved> <h>Ramones: Hey! Ho! Let's Go</h> <div class="excode"> <p><strong>code:</strong></p> <pre><code><h>Ramones: Hey! Ho! Let's Go</h></code></pre> </div> <div class="info"> <p>This page uses the <strong>recommended, stand-alone</strong> version of <code><h></code>. You should use this if: you are working in a HTML5 environment; all your sectioning is done via HTML5 sectioning elements and JavaScript will be available.</p> <p>If any of these conditions are not met, we suggest you use the <a href="demo-fallback.html">fallback version</a>, which extends <code><h1></code> instead. More information can be found in the <a href="https://github.com/ThePacielloGroup/h#h">README</a>.</p> </div> <h>Heading text level 1</h> <section><h>Heading text level 2</h> <section><h>Heading text level 3</h> <section><h>Heading text level 4</h> <section><h>Heading text level 5</h> <section><h>Heading text level 6</h> </section> </section> </section> </section> </section> <div class="excode"> <p><strong>code:</strong></p> <pre><code><h>Heading text level 1</h> <section><h>Heading text level 2</h> <section><h>Heading text level 3</h> <section><h>Heading text level 4</h> <section><h>Heading text level 5</h> <section><h>Heading text level 6</h> </section> </section> </section> </section> </section></code></pre> </div> </body> </html> -
jonathantneal revised this gist
Jun 19, 2014 . 1 changed file with 33 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,33 @@ h { display: block; } h6, h { font-size: 0.67em; margin: 2.33em 0; } h5, h[level="5"] { font-size: 0.83em; margin: 1.67em 0; } h4, h[level="4"] { font-size: 1em; margin: 1.33em 0; } h3, h[level="3"] { font-size: 1.17em; margin: 1em 0; } h2, h[level="2"] { font-size: 1.5em; margin: 0.83em 0; } h1, h[level="1"] { font-size: 2em; margin: 0.67em 0; } -
jonathantneal revised this gist
Jun 19, 2014 . 2 changed files with 56 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -12,16 +12,19 @@ } } // IE9-11 DOMSubtreeModified needs a timeout setTimeout(function () { // define heading role node.setAttribute('role', 'heading'); // define heading level node.setAttribute('level', level); node.setAttribute('aria-level', level); }); } function defineHeadings() { Array.prototype.forEach.call(document.getElementsByTagName(nodeName), defineHeading); } // if heading is an unknown element This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ (function (nodeName, sectionRE) { function defineHeading(node) { // initialize heading level as 1 var level = 1, parent = node; // while parent element exists while (parent = parent.parentElement) { // if parent element is a sectioning element if (sectionRE.test(parent.nodeName)) { // increase heading level ++level; } } // IE9-11 DOMSubtreeModified needs a timeout setTimeout(function () { // define heading role node.setAttribute('role', 'heading'); // define heading level node.setAttribute('level', level); node.setAttribute('aria-level', level); }); } function defineHeadings() { for (var all = document.getElementsByTagName(nodeName), index = 0; all[index]; ++index) { defineHeading(all[index]); } } // if heading is an unknown element if (document.addEventListener) { if (document.createElement(nodeName) instanceof HTMLUnknownElement) { defineHeadings(); document.addEventListener('DOMContentLoaded', defineHeadings); document.addEventListener('DOMSubtreeModified', defineHeadings); } } // or this is Internet Explorer else { document.createElement(nodeName); document.attachEvent('onreadystatechange', defineHeadings); document.attachEvent('onpropertychange', defineHeadings); } })('h', /^(article|aside|nav|section)$/i); -
jonathantneal created this gist
Jun 19, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ (function (nodeName, sectionRE) { function defineHeading(node) { // initialize heading level as 1 var level = 1, parent = node; // while parent element exists while (parent = parent.parentElement) { // if parent element is a sectioning element if (sectionRE.test(parent.nodeName)) { // increase heading level ++level; } } // define heading role node.setAttribute('role', 'heading'); // define heading level node.setAttribute('level', level); node.setAttribute('aria-level', level); } function defineHeadings() { Array.prototype.forEach.call(document.querySelectorAll(nodeName), defineHeading); } // if heading is an unknown element if (document.createElement(nodeName) instanceof HTMLUnknownElement) { defineHeadings(); document.addEventListener('DOMContentLoaded', defineHeadings); document.addEventListener('DOMSubtreeModified', defineHeadings); } })('h', /^(article|aside|nav|section)$/i);