photon icon indicating copy to clipboard operation
photon copied to clipboard

More accurate input focus ring

Open developit opened this issue 10 years ago • 5 comments

I'd like to suggest a more accurate (at least in terms of OS X) input focus outline/border including the nice little animation Apple added in Yosemite.

Preview:

preview

JSFiddle Demo:

http://jsfiddle.net/developit/2xpnn03s/

SCSS:

.form-control {
    box-shadow: 0 0 0 7px rgba(109,179,253,0);

    &:focus {
        box-shadow: 0 0 0 1px rgba(109,179,253,0.8);
        transition: box-shadow 250ms ease-out;
        cursor: text;
    }
}

... thoughts?

developit avatar Oct 22 '15 15:10 developit

That looks great! :+1:

goodseller avatar Oct 26 '15 09:10 goodseller

@developit Rad. This is cool but we'll need to add a separate class instead of using the base .form-control. Only since .form-control is used for more things that text inputs.

connors avatar Oct 31 '15 20:10 connors

Sounds like a plan, because as far as I can tell OS X only seems to use the zoom animation for some fields anyway, so perhaps the best approach is just an optional modified class that can be added to (textual) inputs. If you have a className in mind, I can do a PR.

developit avatar Oct 31 '15 21:10 developit

+1

luizbills avatar Nov 03 '15 16:11 luizbills

+1

KhanMaytok avatar Dec 22 '15 17:12 KhanMaytok