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

Add support for a toolbar-input #33

Open developit opened 9 years ago

developit commented 9 years ago

Add toolbar-input. I couldnt decide on markup for a generic input with inset icon. This at least partly addresses #14.

JSFiddle: http://jsfiddle.net/developit/aqu10kd9/ *

Preview:

preview

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

* the zoom border effect is not included in this PR

connors commented 8 years ago

@developit Awesome! However, I don't think this feature should be specific to toolbars. Icon inputs should be a feature available anywhere in the application.

So the base markup structure should probably be something like:

<div class="form-icon-text-group form-group">
  <span class="icon icon-search"></span>
  <input type="search" class="form-control" placeholder="Search...">
</div>

Then the SASS could be something like:

.form-icon-text-group {
  position: relative;

  .icon {
    position: absolute;
    top: 4px;
    left: 10px;
    z-index: 1;
  }

  .form-control {
    padding-left: 25px;
  }
}

Lastly, to get things working in the toolbar, all you have to do is remove the .form-group class.

developit commented 8 years ago

Agreed regarding a generic solution. That markup works for me.

szechyjs commented 7 years ago

any updates on this?