Assemble Buttons
Assemble Buttons is a component of the Assemble CSS Framework. It will give you a solid base for buttons in your project. It has some default styles that can easily be overridden so you can add your own look.
Requirements
Assemble Buttons requires Assemble Base.
Installation
npm install assemble-buttons --save-dev
Usage
Gulp
var gulp = ;var postcss = ;var assembleBase = ;var assembleButtons = ; gulp;
Then import the _assemble-buttons.css file from your css file.
; /*Override variables here before the Assemble Components are loaded.*/ ;
Options
Options are set with variables. These variables are already set with their default values so they will just work out of the box. If you wish to change them just define the variable you want to change before you load the _assemble-modals.css file. You may wish you see Assemble Base for more examples and directions for setting up a Assemble project.
Design Variables
$btn-size-ratio
- Set how quickly the buttons scale.
- Default: 1.2;
- Type: Number
$
$btn-padding
- Button padding. Can have single or multiple values.
- Default: 0.7em;
- Type: Number
$
$btn-default-font-size
- The default button font size
- Default: 100%;
- Type: Number
$
$btn-border-size
- The size of the button border. Is only used if border-color is used.
- Default: 1px;
- Type: Number
$
$btn-disabled-bg-color
- The background color of a disabled button. Is only used if $btn-disabled is true.
- Default: #DDD;
- Type: Color
$
$btn-disabled-text-color
- The text color of a disabled button. Is only used if $btn-disabled is true.
- Default: #777;
- Type: Color
$
Button Colors
You will need to set a color class by using this syntax: .btn--(color name)
Then you have six options to set. None are required. They are:
- bg-color
- text-color
- border-color
- bg-hover-color
- text-hover-color
- border-hover-color
Example
Will output:
Usage
Primary Button
Modifier Variables
Button Sizes
$btn--large
- Turn on/off large buttons for your application. If set to true a .btn--large class will be generated.
- Default: false;
- Type: Boolean
$
Will give you:
Usage
Primary ButtonPrimary Button
$btn--small
- Turn on/off small buttons for your application. If set to true a .btn--small class will be generated.
- Default: false;
- Type: Boolean
$
Will give you:
Usage
Primary ButtonPrimary Button
$btn--block
- Turn on/off block buttons for your application. If set to true a .btn--block class will be generated.
- Default: false;
- Type: Boolean
$
Will give you:
Usage
Block Primary Button
Button Types
$btn--natural
- Turn on/off natural buttons for your application. If set to true a .btn--natural class will be generated.
- Use this if you'd like buttons to appear in the middle of sentences.
- Default: false;
- Type: Boolean
$
Will give you:
Usage
Here is some next that has a button natural in the middle of it.
$btn--disabled
- Turn on/off disabled buttons for your application. If set to true a .btn--disabled class will be generated.
- Use this if you will be having buttons that are disabled in your app.
- Default: false;
- Type: Boolean
$
Will give you:
Usage
Disabled Primary Button
Button Group
- Turn on/off grouped buttons for your application. If set to true a .btn-group class will be generated.
- Use this if you will be having buttons that are grouped together in your app.
- You will need to have a wrapping div around your buttons that has the class .btn-group.
- Default: false;
- Type: Boolean
- If true the css for button groups will be loaded.
$
Will give you:
Usage
Button One Button One Button One
Button Clean Up
- Included automatically