connors / photon

The fastest way to build beautiful Electron apps using simple HTML and CSS
photonkit.com
MIT License
10.01k stars 580 forks source link

More accurate input focus ring #54

Open developit opened 8 years ago

developit commented 8 years ago

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?

goodseller commented 8 years ago

That looks great! :+1:

connors commented 8 years ago

@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.

developit commented 8 years ago

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.

luizbills commented 8 years ago

+1

KhanMaytok commented 8 years ago

+1