Created
February 12, 2015 04:46
-
-
Save csssecrets/41c8da81742e1ab1d07f to your computer and use it in GitHub Desktop.
Indicating disabled state
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 characters
/** | |
* Indicating disabled state | |
*/ | |
:disabled, [disabled], [aria-disabled="true"] { | |
cursor: not-allowed; | |
} |
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 characters
<button>Button</button> | |
<button disabled>Disabled button</button> |
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 characters
function $$(selector, context) { | |
context = context || document; | |
var elements = context.querySelectorAll(selector); | |
return Array.prototype.slice.call(elements); | |
} | |
$$('.circular').forEach(function(el) { | |
var NS = "http://www.w3.org/2000/svg"; | |
var svg = document.createElementNS(NS, "svg"); | |
svg.setAttribute("viewBox", "0 0 100 100"); | |
var circle = document.createElementNS(NS, "path"); | |
circle.setAttribute("d", "M0,50 a50,50 0 1,1 0,1z"); | |
circle.setAttribute("id", "circle"); | |
var text = document.createElementNS(NS, "text"); | |
var textPath = document.createElementNS(NS, "textPath"); | |
textPath.setAttributeNS("http://www.w3.org/1999/xlink", 'xlink:href', '#circle'); | |
textPath.textContent = el.textContent; | |
text.appendChild(textPath); | |
svg.appendChild(circle); | |
svg.appendChild(text); | |
el.textContent = ''; | |
el.appendChild(svg); | |
}); |
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 characters
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment