Git Product home page Git Product logo

buttons's Introduction

Buttons 2.0

Sauce Test Status

Build Status

Buttons 2.0

Buttons is a highly customizable production ready mobile web and desktop css button library. Buttons is a free open source project created using Sass.

Authors Alex Wolfe and Rob Levin.

Showcase Demo

View the showcase demo to see the buttons in action. The showcase provides a full list of examples along with code snippets to speed up development.

Buttons 2.0 Showcase

Setup & Installation

  1. Download the latest buttons.css
  2. Include buttons in your website:
  <!-- Buttons core css -->
  <link rel="stylesheet" href="css/buttons.css">

  <!-- Only needed if you want support for dropdown menus -->
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <script type="text/javascript" src="js/buttons.js"></script>

  <!-- Only needed if you want font icons -->
  <link href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css" rel="stylesheet">

Bower Installation

  1. If you're using Bower you can run bower install Buttons

Transitioning From Buttons 1.0 to Buttons 2.0

We've made some major improvements to the Buttons library. In order to integrate buttons into your current project you'll need to make the following changes:

  1. Compass has been replaced with autoprefixer. Compass is not recommended but it is still supported.
  2. Button colors are now completely independent (ex. button-primary). We no longer have classes like button-flat-primary, so to achieve this you now simply add button-flat button-primary
  3. Buttons styles are now independent (ex. button-flat, button-3d, etc.). You can apply these styles and they will automatically pick up the color attached to the button (ex. button-primary button-3d).

Customize Buttons (Recommended uses Sass & Autoprefixer)

  1. Clone the Buttons repository.
  2. Make sure you have node.js installed.
  3. From the command line cd into the root for the Buttons directory.
  4. Run npm install or sudo npm install (depending on your system permissions).
  5. On the command line run grunt dev; this will open a browser with Buttons.
  6. Locate scss in the root directory.
  7. You can modify the _options.scss file where you can customize colors, typography, etc.
  8. Anytime you save your changes the Buttons showcase page will live reload with your changes!

Customize Buttons with only Sass or Compass

  1. Clone the Buttons repo.
  2. Make sure you have Sass installed.
  3. Run npm install from your terminal.
  4. Edit the _options.scss with your own custom values (see example values below).
  5. Buttons now works with or without Compass, so choose one of the following examples accordingly and run from the command line in Buttons's root directory:
    For Sass run: $ sass --watch --scss scss/buttons.scss:css/buttons.css
    For Compass run: $ compass watch
  6. The css/buttons.css file should now be updated.

Button Options

To edit Buttons simply change values within the _options.scss file. After you make your edits recompile your sass file and your changes will get processed.

  • $ubtn: This prefix stands for Unicorn Button and prevents namespace collisions that could occur if you import buttons as part of your Sass build process. We kindly ask you not to use the prefix $ubtn in your project in order to avoid possible name conflicts. Thanks!
  • $ubtn-namespace: Desired CSS namespace for your buttons (default .button)
  • $ubtn-glow-namespace: Desired CSS namespace for your glow effect (default .glow)
  • $ubtn-colors: List of colors in format like (name, background, color).
  • $ubtn-glow-color: Default glow color (#2c9adb, light blue)
  • $ubtn-shapes: List of shapes in format like (square 0px). You can use Sass maps if you're using 3.3. See _options.scss for details.
  • $ubtn-sizes: List of sizes in format like (jumbo 1.5). You can use Sass maps if you're using 3.3. See _options.scss for details.
  • $ubtn-bgcolor: Default button background color (#EEE, light gray)
  • $ubtn-height: Default height, also used to calculate padding on the sides (32px)
  • $ubtn-font-family: Default font family
  • $ubtn-font-color: Default font color (#666, gray)
  • $ubtn-font-weight: Default font weight
  • $ubtn-font-size: Default font size (14px). You can also specify a value of inherit and it will be respected.

Excluding Button Types

By default, Buttons will include all button types. You can exclude types from your compilation by simply removing the corresponding @import statement in the buttons.scss file.

//Example import statement for 3d button.
@import 'types/3d';

Remove this statement then recompile to create a build without 3d buttons.

Browser Support

Buttons works in all modern browsers (Firefox, Chrome, Safari, IE) and gracefully degrades all to Internet Explorer 8.

About Buttons

Buttons is part of the Unicorn-UI Framework. Created by Alex Wolfe @alexwolfe and Rob Levin @roblevintennis .

buttons's People

Contributors

alextsg avatar alexwolfe avatar amitburst avatar bitdeli-chef avatar bryant1410 avatar charmander avatar kkirsche avatar lbeauvisage avatar maqnouch avatar meteorlxy avatar prayagverma avatar rajahafify avatar roblevintennis avatar romainsauvaire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

buttons's Issues

Remove dotted line within Firefox

When clicking the buttons within Firefox it shows a dotted outline. This outline can be removed from anchor tags with this:

a:focus { 
    outline: none; 
}

If you are working with button tags, which I don't think you are, you can use this:

button::-moz-focus-inner {
    border: 0;
}

reference

Showcase demo not working

Showcase demo provided in documentation is currently not working, seems like some sort of hosting problem - see http://unicorn-ui.com/buttons/
Redirects to generic Account Suspended page

This Account has been suspended.
Contact your hosting provider for more information.

button link

I'm not sure why our unicorn-ui github doesn't have an issues cc / @alexwolfe .. but I'm about to fix something for Mavenlink where we need to convert anchor's without href's to buttons that "look like links" e.g. a typical grey Cancel button link thingy :) I noticed bootstrap has a btn-link and I'm going to do something like that for Mavenlink. But we probably ought to add that to this library when we can and I'm just capturing that here. See http://getbootstrap.com/css/#buttons-options

Typo in README

The correct command to install your library is bower install Buttons (capital B)

Drop down menu not working

Drop down menu not working when clicking exactly over the icon "fa fa-caret-down"

<div class="button-group">
    <button type="button" class="button button-primary button-small"><i class="fa fa-edit"></i></button>

    <span class="button-dropdown button-dropdown-primary" data-buttons="dropdown">
      <a href="#" class="button button-primary button-small"><i class="fa fa-caret-down"></i></a>

      <ul class="button-dropdown-list is-below">
          <li class="button-dropdown-divider"><a href="#">Duplicate</a></li>
          <li class="button-dropdown-divider"><a href="#">Delete</a></li>
      </ul>
    </span>
</div>

[feature] support for button 'pressed' state

I need buttons that have boolean state (on|off). After doing research the :active state is unsuitable for this http://stackoverflow.com/questions/12960068/keep-css-active-state-after-click-with-jquery more preferable is to add an .active class. Then in jquery you can do $('button').toggleClass('active') upon click. I just tried this out on my local build, all I had to do in the css is to replace every instance of :active to .active. I propose this library drop support for :active and switch over to using a class.

Border buttons should use currentcolor

@alexwolfe Trever showed me a that currentColor is a bonafide CSS value that will keep these in sync. It's not a big deal but a nicety that if you change one color the other just automatically changes. I think Trever's gonna take this one.

Undefined mixin 'box-shadow'

HI guys,

love your buttons. I just wanted to use a few in existing project, so maybe i forgot to copy from your files. but getting this Undefined mixin 'box-shadow'. I can not see where in your files you define it. thanks

Supported browsers

hello!
Great work you are sharing here. Thank you!

Is there somewhere a list of supported browsers?

Thank you

Hi Alex,

thanks a lot for awesome buttons, I appreciate your work.

Rafał

Menu buttons require extra click

Your implementation of the menu buttons requires an exclusive click to dismiss the menu. So if the user intended to click elsewhere, it would take 2 clicks. I noticed that the menu actually hijacks all of the web page interaction by adding an overlay on top. This doesn't help with the user experience. An easy way to test this in your demo is to click across multiple menu buttons and see how it takes 2 clicks every time you want to click the next item.

If you try the bootstrap demo below (and other frameworks, e.g. ExtJS), you'll see that you only need to click once to jump to the next menu or to click on a different component: http://getbootstrap.com/components/#btn-dropdowns

Another example is GitHub. Click "This repository" to reveal the search options, then click the search field next to it. It takes just a click to switch.

a href doesn't go to the link

Hi there,

A simple question,how can I go to the link when I remplace the ?

When I click on buttons I cannot go to the link that I use.

Thanks
any where good job for this design buttons

implementation with Laravel

Is there anyone who knows how to implement this library with Laravel 5.1?

I find it difficult to integrate using elixir.

thanks.

Button text overflows when pressed

When the text is too large to fit into the button, it's hidden like so (full text is "start free crash course"):

screenshot from 2015-09-03 17 20 01

except when the button is pressed:
screenshot from 2015-09-03 17 20 20

Setting overflow: hidden on the element prevents the button text from leaking outside.

cannot override _options.scss properties without editing the file itself

Hi,
I wanted to change the properties set in _options.scss, but as the properties are not flagged with !default, I could not do it without editing the file itself... so I had to add the Buttons library into git and edit the file. But I would prefer to avoid this solution, in order to keep a better overview on the overrides I perform...

extending

how can i extend from your library?

for example i want my all buttons have a style as
class='button button-rounded button-flat-primary'

I could not find what to extend in my scss...

thanks

Border Aliasing on Raised buttons with IE11

In the homepage http://unicorn-ui.com/buttons/ displayed by IE11, in the third button group (Royal / Raised), an aliasing effect affect the 1st- and 3rd-button borders, varying at window resize.

Therefore the buttons seem to be in different states.

I couldn't reproduce this issue with Firefox or Chrome so maybe it's an IE bug.

Warning Issue with Linear Gradient

Hello,
When i am running npm run dev it shows warning like this
sass/buttons/buttons.scss:1004:3: Gradient has outdated direction syntax. New syntax is like to leftinstead ofright.
please fix it

Normal sized buttons font-size is wrong

If you go to the Button Sizes section of the builder page, and increase the "normal" sized button by 2px (up to 16px) the button looked correct in relation to the small and large buttons.

.button-small font size is too large

Take a look at this attachment:

screen shot 2013-11-29 at 8 50 33 pm

Notice that the 3rd button from the left is smaller overall, but larger text than the 'standard' size button, the one immediately to the left.

I see this in latest builds of FF and Chrome on OSX 10.9.

How to change color of a button ?

Hi

does exist a way to change the button color ? if not, can it be possible to override the gradient via the provided class .button ?

thanks

Variable Globals Depreciation Warning

With Sass 3.3.4 (Maptastic Maple)

Am getting a lot of noisy warnings along the lines of

DEPRECATION WARNING on line 17 of sass/base/buttons/_buttons.scss:
Assigning to global variable "$unicorn-btn-tinyfs" by default is deprecated.
In future versions of Sass, this will create a new local variable.
If you want to assign to the global variable, use "$unicorn-btn-tinyfs: $unicorn-btn-font-size - 2 !global" instead.
Note that this will be incompatible with Sass 3.2.

the buttons library also seems to add a lot to compile time
is that normal?
Upshot being I'm thinking there is more to this than noise - ie just adding :quiet isn't going to resolve that.

How would you feel about updating to the new global variable approach?

Use with bootstrap

when I use it with bootstrap, and when I use <a></a>, the button goes ugly!

Because the <a> in bootstrap will override the button while there's no CSS that like a.button.

Gulp-sass: error parsing interpolated value

[21:33:42] gulp-notify: [Error running Gulp] styles failed, check the logs..
[21:33:42] styles error: Error in plugin 'gulp-sass'
Message:
    bower_components/Buttons/scss/types/_longshadow.scss
  21:16  error parsing interpolated value
Details:
    column: 16
    line: 21
    file: /Users/rolle/Projects/dudetest/bower_components/Buttons/scss/types/_longshadow.scss
    status: 1
    messageFormatted: bower_components/Buttons/scss/types/_longshadow.scss
  21:16  error parsing interpolated value

What I'm using:

"bower": "^1.4.1",
"browser-sync": "~2.7.12",
"gulp": "^3.9.0",
"gulp-autoprefixer": "2.3.1",
"gulp-cache": "0.2.10",
"gulp-changed": "^1.2.1",
"gulp-concat": "2.5.2",
"gulp-css-globbing": "^0.1.8",
"gulp-header": "1.2.2",
"gulp-imagemin": "^2.2.1",
"gulp-minify-css": "1.1.6",
"gulp-notify": "^2.2.0",
"gulp-pixrem": "^0.2.3",
"gulp-plumber": "^1.0.1",
"gulp-sass": "^2.0.1",
"gulp-sourcemaps": "^1.5.2",
"gulp-uglify": "1.2.0",
"gulp-util": "^3.0.5",

It works when if I disable Long Shadow Function all together.

Sass 3.3 Compatibility Issues

Hi there, just found this project and great work. Attempting to integrate it into a project I am working on.

I am running Sass 3.3.8 and getting a lot of deprecation warning when compiling.

DEPRECATION WARNING on line 18 of /....../_buttons.scss:
Assigning to global variable "$unicorn-btn-smallfs" by default is deprecated.
In future versions of Sass, this will create a new local variable.
If you want to assign to the global variable, use "$unicorn-btn-smallfs: $unicorn-btn-font-size + 1 !global" instead.
Note that this will be incompatible with Sass 3.2.

Is this a known issue or being addressed?

Thank you

Does exist a list of icons ?

Hi

does exist a list for icons usage ? because it seem to be different than bootsrap ones.
because i would to use ones for facebook or twitter like:
<i class="fa fa-facebook-square"></i>

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.