Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form Inputs with inset icons #14

Open
L3V147H4N opened this issue Oct 14, 2015 · 7 comments
Open

Form Inputs with inset icons #14

L3V147H4N opened this issue Oct 14, 2015 · 7 comments

Comments

@L3V147H4N
Copy link

This is purely a aesthetic feature but it's pretty neat nonetheless and it also helps to save some space and create a better feeling to the UX

Bootstrap Forms

Another example

osx search

@brunowego
Copy link

Cool 👍

@developit
Copy link
Contributor

Here's my suggestion:
http://jsfiddle.net/developit/aqu10kd9/
preview

Markup

<label class="toolbar-input">
    <span class="icon icon-search"></span>
    <input type="search" class="form-control" placeholder="Search...">
</label>

CSS

/* Here's my suggestion for the CSS */
.toolbar-input {
    position: relative;
    overflow: visible;
    margin: 0;
    padding: 0;
    .icon {
        position: absolute;
        left: 10px;
        top: 4px;
        z-index: 1;
        opacity: 0.5;  /* ~matches placeholder */
    }
    .form-control {
        padding: 3px 4px 1px 24px;
        border-radius: 12px;
        box-shadow: inset 0 1px 2px rgba(0,0,0,0.4),
                    0 0 0 7px rgba(109,179,253,0);

        &:focus {
            /* something like this was already in place: */
            box-shadow: inset 0 1px 2px rgba(0,0,0,0.4),
                        0 0 0 1px rgba(109,179,253,0.8);
            transition: box-shadow 250ms ease-out;
        }
    }
}

@connors
Copy link
Owner

connors commented Oct 16, 2015

Rad!

@goodseller
Copy link

👍

@sbruchmann
Copy link

@developit Mind sending a pull request?

@developit
Copy link
Contributor

@sbruchmann: I did, #33.

@sbruchmann
Copy link

Sorry, @developit, I’ve overlooked that reference. Thanks for the work! Now we have to wait for @connors to merge it (at least, the folks who don’t know their way around git 😄)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants