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

[Feature requests] In-button Icon #53

Open goodseller opened 8 years ago

goodseller commented 8 years ago

This feature sees in bootstrap or jquery ui (the style):

https://gyazo.com/1309644b527e99169301e27485c757ee

I did the above prototype by adding (changing?) these lines:

  .btn .icon {
    float: inherit;
    color: inherit;
  }

Toolbar:

      <footer class="toolbar toolbar-footer">
        <div class="toolbar-actions">
          <button class="btn btn-default">
            <span class="icon icon-cancel"></span> Cancel
          </button>

          <button class="btn btn-primary pull-right">
            Send <span class="icon icon-mail"></span>
          </button>
        </div>
      </footer>

(Currently, this is a quick prototype.)

developit commented 8 years ago

Good addition. Just a tip: you can add the icon-text class to the icon so it sits nicely alongside the button's label.

<button class="btn btn-primary">
    <span class="icon icon-text icon-mail"></span>
    Send Message
</button>
goodseller commented 8 years ago

Thanks @developit . I don't know there was a icon text before.

To support the right side icon, I make a pull request https://github.com/connors/photon/pull/62