Last active
December 15, 2015 18:19
-
-
Save dmitryshimkin/5303410 to your computer and use it in GitHub Desktop.
Revisions
-
dmitryshimkin renamed this gist
Jun 1, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
dmitryshimkin renamed this gist
Apr 3, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
dmitryshimkin created this gist
Apr 3, 2013 .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,14 @@ /* mixin */ .focus(@className: "focused") { behavior: ~"expression(function focus(el) { el.runtimeStyle.behavior = 'none'; var focusClass = ' @{className}'; el.onfocus = function() { el.className += (focusClass); }; el.onblur = function() { el.className = el.className.replace(new RegExp(focusClass, 'g'), ''); }; }(this))"; } /* usage */ .input { .focus("input_focused"); .input:focus, .input_focused { border-color: blue; } }