themepile-abstractio 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +28 -0
- data/.rbenv-version +1 -0
- data/CONTRIBUTING.md +53 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +136 -0
- data/Rakefile +2 -0
- data/abstractio.gemspec +18 -0
- data/js/foundation/foundation.alerts.js +50 -0
- data/js/foundation/foundation.clearing.js +516 -0
- data/js/foundation/foundation.cookie.js +74 -0
- data/js/foundation/foundation.dropdown.js +159 -0
- data/js/foundation/foundation.forms.js +516 -0
- data/js/foundation/foundation.joyride.js +842 -0
- data/js/foundation/foundation.js +403 -0
- data/js/foundation/foundation.magellan.js +130 -0
- data/js/foundation/foundation.orbit.js +373 -0
- data/js/foundation/foundation.placeholder.js +159 -0
- data/js/foundation/foundation.reveal.js +276 -0
- data/js/foundation/foundation.section.js +409 -0
- data/js/foundation/foundation.tooltips.js +206 -0
- data/js/foundation/foundation.topbar.js +252 -0
- data/js/foundation/index.js +16 -0
- data/js/vendor/custom.modernizr.js +4 -0
- data/js/vendor/jquery.js +9597 -0
- data/js/vendor/zepto.js +1884 -0
- data/lib/abstractio.rb +17 -0
- data/lib/abstractio/engine.rb +20 -0
- data/lib/abstractio/generators/USAGE +15 -0
- data/lib/abstractio/generators/install_generator.rb +54 -0
- data/lib/abstractio/generators/templates/application.html.erb +46 -0
- data/lib/abstractio/generators/templates/application.html.haml +31 -0
- data/lib/abstractio/generators/templates/application.html.slim +28 -0
- data/lib/abstractio/version.rb +3 -0
- data/lib/themepile-abstractio.rb +17 -0
- data/scss/abstractio.scss +46 -0
- data/scss/abstractio/_variables.scss +1224 -0
- data/scss/abstractio/components/_alert-boxes.scss +107 -0
- data/scss/abstractio/components/_block-grid.scss +68 -0
- data/scss/abstractio/components/_breadcrumbs.scss +125 -0
- data/scss/abstractio/components/_button-groups.scss +89 -0
- data/scss/abstractio/components/_buttons.scss +227 -0
- data/scss/abstractio/components/_clearing.scss +224 -0
- data/scss/abstractio/components/_custom-forms.scss +263 -0
- data/scss/abstractio/components/_dropdown-buttons.scss +115 -0
- data/scss/abstractio/components/_dropdown.scss +150 -0
- data/scss/abstractio/components/_flex-video.scss +46 -0
- data/scss/abstractio/components/_forms.scss +362 -0
- data/scss/abstractio/components/_global.scss +280 -0
- data/scss/abstractio/components/_grid.scss +186 -0
- data/scss/abstractio/components/_inline-lists.scss +53 -0
- data/scss/abstractio/components/_joyride.scss +215 -0
- data/scss/abstractio/components/_keystrokes.scss +57 -0
- data/scss/abstractio/components/_labels.scss +85 -0
- data/scss/abstractio/components/_magellan.scss +23 -0
- data/scss/abstractio/components/_orbit.scss +213 -0
- data/scss/abstractio/components/_pagination.scss +100 -0
- data/scss/abstractio/components/_panels.scss +77 -0
- data/scss/abstractio/components/_pricing-tables.scss +131 -0
- data/scss/abstractio/components/_progress-bars.scss +71 -0
- data/scss/abstractio/components/_reveal.scss +132 -0
- data/scss/abstractio/components/_section.scss +318 -0
- data/scss/abstractio/components/_side-nav.scss +69 -0
- data/scss/abstractio/components/_split-buttons.scss +167 -0
- data/scss/abstractio/components/_sub-nav.scss +68 -0
- data/scss/abstractio/components/_switch.scss +251 -0
- data/scss/abstractio/components/_tables.scss +84 -0
- data/scss/abstractio/components/_thumbs.scss +48 -0
- data/scss/abstractio/components/_tooltips.scss +117 -0
- data/scss/abstractio/components/_top-bar.scss +495 -0
- data/scss/abstractio/components/_type.scss +426 -0
- data/scss/abstractio/components/_visibility.scss +322 -0
- data/scss/normalize.scss +402 -0
- data/templates/project/.gitignore +44 -0
- data/templates/project/MIT-LICENSE.txt +20 -0
- data/templates/project/config.rb +26 -0
- data/templates/project/humans.txt +8 -0
- data/templates/project/index.html +124 -0
- data/templates/project/manifest.rb +45 -0
- data/templates/project/robots.txt +4 -0
- data/templates/project/scss/app.scss +48 -0
- data/templates/upgrade/manifest.rb +34 -0
- metadata +153 -0
@@ -0,0 +1,107 @@
|
|
1
|
+
//
|
2
|
+
// Alert Variables
|
3
|
+
//
|
4
|
+
$include-html-alert-classes: $include-html-classes !default;
|
5
|
+
|
6
|
+
// We use this to control alert padding.
|
7
|
+
$alert-padding-top: emCalc(11px) !default;
|
8
|
+
$alert-padding-default-float: $alert-padding-top !default;
|
9
|
+
$alert-padding-opposite-direction: $alert-padding-top + emCalc(10px) !default;
|
10
|
+
$alert-padding-bottom: $alert-padding-top + emCalc(1px) !default;
|
11
|
+
|
12
|
+
// We use these to control text style.
|
13
|
+
$alert-font-weight: bold !default;
|
14
|
+
$alert-font-size: emCalc(14px) !default;
|
15
|
+
$alert-font-color: #fff !default;
|
16
|
+
$alert-font-color-alt: darken($secondary-color, 60%) !default;
|
17
|
+
|
18
|
+
// We use this for close hover effect.
|
19
|
+
$alert-function-factor: 10% !default;
|
20
|
+
|
21
|
+
// We use these to control border styles.
|
22
|
+
$alert-border-style: solid !default;
|
23
|
+
$alert-border-width: 1px !default;
|
24
|
+
$alert-border-color: darken($primary-color, $alert-function-factor) !default;
|
25
|
+
$alert-bottom-margin: emCalc(20px) !default;
|
26
|
+
|
27
|
+
// We use these to style the close buttons
|
28
|
+
$alert-close-color: #333 !default;
|
29
|
+
$alert-close-position: emCalc(5px) !default;
|
30
|
+
$alert-close-font-size: emCalc(22px) !default;
|
31
|
+
$alert-close-opacity: 0.3 !default;
|
32
|
+
$alert-close-opacity-hover: 0.5 !default;
|
33
|
+
$alert-close-padding: 5px 4px 4px !default;
|
34
|
+
|
35
|
+
// We use this to control border radius
|
36
|
+
$alert-radius: $global-radius !default;
|
37
|
+
|
38
|
+
//
|
39
|
+
// Alert Mixins
|
40
|
+
//
|
41
|
+
|
42
|
+
// We use this mixin to create a default alert base.
|
43
|
+
@mixin alert-base {
|
44
|
+
border-style: $alert-border-style;
|
45
|
+
border-width: $alert-border-width;
|
46
|
+
display: block;
|
47
|
+
font-weight: $alert-font-weight;
|
48
|
+
margin-bottom: $alert-bottom-margin;
|
49
|
+
position: relative;
|
50
|
+
padding: $alert-padding-top $alert-padding-opposite-direction $alert-padding-bottom $alert-padding-default-float;
|
51
|
+
font-size: $alert-font-size;
|
52
|
+
}
|
53
|
+
|
54
|
+
// We use this mixin to add alert styles
|
55
|
+
@mixin alert-style($bg:$primary-color) {
|
56
|
+
|
57
|
+
// This find the lightness percentage of the background color.
|
58
|
+
$bg-lightness: lightness($bg);
|
59
|
+
|
60
|
+
// We control which background color and border come through.
|
61
|
+
background-color: $bg;
|
62
|
+
border-color: darken($bg, $alert-function-factor);
|
63
|
+
|
64
|
+
// We control the text color for you based on the background color.
|
65
|
+
@if $bg-lightness > 70% { color: $alert-font-color-alt; }
|
66
|
+
@else { color: $alert-font-color; }
|
67
|
+
|
68
|
+
}
|
69
|
+
|
70
|
+
// We use this to create the close button.
|
71
|
+
@mixin alert-close {
|
72
|
+
font-size: $alert-close-font-size;
|
73
|
+
padding: $alert-close-padding;
|
74
|
+
line-height: 0;
|
75
|
+
position: absolute;
|
76
|
+
top: $alert-close-position + emCalc(2px);
|
77
|
+
#{$opposite-direction}: $alert-close-position;
|
78
|
+
color: $alert-close-color;
|
79
|
+
opacity: $alert-close-opacity;
|
80
|
+
&:hover,
|
81
|
+
&:focus { opacity: $alert-close-opacity-hover; }
|
82
|
+
}
|
83
|
+
|
84
|
+
// We use this to quickly create alerts with a single mixin.
|
85
|
+
@mixin alert($bg:$primary-color, $radius:false) {
|
86
|
+
@include alert-base;
|
87
|
+
@include alert-style($bg);
|
88
|
+
@include radius($radius);
|
89
|
+
}
|
90
|
+
|
91
|
+
@if $include-html-alert-classes != false {
|
92
|
+
|
93
|
+
/* Foundation Alerts */
|
94
|
+
.alert-box {
|
95
|
+
@include alert;
|
96
|
+
|
97
|
+
.close { @include alert-close; }
|
98
|
+
|
99
|
+
&.radius { @include radius($alert-radius); }
|
100
|
+
&.round { @include radius($global-rounded); }
|
101
|
+
|
102
|
+
&.success { @include alert-style($success-color); }
|
103
|
+
&.alert { @include alert-style($alert-color); }
|
104
|
+
&.secondary { @include alert-style($secondary-color); }
|
105
|
+
}
|
106
|
+
|
107
|
+
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
//
|
2
|
+
// Block Grid Variables
|
3
|
+
//
|
4
|
+
$include-html-grid-classes: $include-html-classes !default;
|
5
|
+
|
6
|
+
// We use this to control the maximum number of block grid elements per row
|
7
|
+
$block-grid-elements: 12 !default;
|
8
|
+
$block-grid-default-spacing: 10px !default;
|
9
|
+
|
10
|
+
//
|
11
|
+
// Block Grid Mixins
|
12
|
+
//
|
13
|
+
|
14
|
+
// We use this mixin to create different block-grids. You can apply per-row and spacing options.
|
15
|
+
// Setting $base-style to false will ommit default styles.
|
16
|
+
@mixin block-grid($per-row:false, $spacing:$block-grid-default-spacing, $base-style:true) {
|
17
|
+
|
18
|
+
@if $base-style {
|
19
|
+
display: block;
|
20
|
+
padding: 0;
|
21
|
+
margin: 0 (-$spacing);
|
22
|
+
@include clearfix;
|
23
|
+
|
24
|
+
&>li {
|
25
|
+
display: inline;
|
26
|
+
height: auto;
|
27
|
+
float: $default-float;
|
28
|
+
padding: 0 $spacing $spacing;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
@if $per-row {
|
33
|
+
&>li {
|
34
|
+
width: 100%/$per-row;
|
35
|
+
padding: 0 $spacing $spacing;
|
36
|
+
|
37
|
+
&:nth-of-type(n) { clear: none; }
|
38
|
+
&:nth-of-type(#{$per-row}n+1) { clear: both; }
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
}
|
43
|
+
|
44
|
+
@if $include-html-grid-classes {
|
45
|
+
/* Foundation Block Grids for below small breakpoint */
|
46
|
+
@media only screen {
|
47
|
+
[class*="block-grid-"] { @include block-grid; }
|
48
|
+
|
49
|
+
@for $i from 1 through $block-grid-elements {
|
50
|
+
.small-block-grid-#{($i)} {
|
51
|
+
@include block-grid($i,$block-grid-default-spacing,false);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
/* Foundation Block Grids for above small breakpoint */
|
57
|
+
@media #{$small} {
|
58
|
+
/* Remove small grid clearing */
|
59
|
+
@for $i from 1 through $block-grid-elements {
|
60
|
+
.small-block-grid-#{($i)} > li:nth-of-type(#{$i}n+1) { clear: none; }
|
61
|
+
}
|
62
|
+
@for $i from 1 through $block-grid-elements {
|
63
|
+
.large-block-grid-#{($i)} {
|
64
|
+
@include block-grid($i,$block-grid-default-spacing,false);
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
@@ -0,0 +1,125 @@
|
|
1
|
+
//
|
2
|
+
// Breadcrumb Variables
|
3
|
+
//
|
4
|
+
$include-html-nav-classes: $include-html-classes !default;
|
5
|
+
|
6
|
+
// We use this to set the background color for the breadcrumb container.
|
7
|
+
$crumb-bg: lighten($secondary-color, 5%) !default;
|
8
|
+
|
9
|
+
// We use these to set the padding around the breadcrumbs.
|
10
|
+
$crumb-padding: emCalc(9px) emCalc(14px) emCalc(9px) !default;
|
11
|
+
$crumb-side-padding: emCalc(12px) !default;
|
12
|
+
|
13
|
+
// We use these to control border styles.
|
14
|
+
$crumb-function-factor: 10% !default;
|
15
|
+
$crumb-border-size: 1px !default;
|
16
|
+
$crumb-border-style: solid !default;
|
17
|
+
$crumb-border-color: darken($crumb-bg, $crumb-function-factor) !default;
|
18
|
+
$crumb-radius: $global-radius !default;
|
19
|
+
|
20
|
+
// We use these to set various text styles for breadcrumbs.
|
21
|
+
$crumb-font-size: emCalc(11px) !default;
|
22
|
+
$crumb-font-color: $primary-color !default;
|
23
|
+
$crumb-font-color-current: #333 !default;
|
24
|
+
$crumb-font-color-unavailable: #999 !default;
|
25
|
+
$crumb-font-transform: uppercase !default;
|
26
|
+
$crumb-link-decor: underline !default;
|
27
|
+
|
28
|
+
// We use these to control the slash between breadcrumbs
|
29
|
+
$crumb-slash-color: #aaa !default;
|
30
|
+
$crumb-slash: "/" !default;
|
31
|
+
|
32
|
+
//
|
33
|
+
// Breakcrumb Mixins
|
34
|
+
//
|
35
|
+
|
36
|
+
// We use this mixin to create a container around our breadcrumbs
|
37
|
+
@mixin crumb-container {
|
38
|
+
display: block;
|
39
|
+
padding: $crumb-padding;
|
40
|
+
overflow: hidden;
|
41
|
+
margin-#{$default-float}: 0;
|
42
|
+
list-style: none;
|
43
|
+
border-style: $crumb-border-style;
|
44
|
+
border-width: $crumb-border-size;
|
45
|
+
|
46
|
+
// We control which background color and border come through.
|
47
|
+
background-color: $crumb-bg;
|
48
|
+
border-color: $crumb-border-color;
|
49
|
+
}
|
50
|
+
|
51
|
+
// We use this mixin to create breadcrumb styles from list items.
|
52
|
+
@mixin crumbs {
|
53
|
+
|
54
|
+
// A normal state will make the links look and act like clickable breadcrumbs.
|
55
|
+
margin: 0;
|
56
|
+
float: $default-float;
|
57
|
+
font-size: $crumb-font-size;
|
58
|
+
text-transform: $crumb-font-transform;
|
59
|
+
color: $crumb-font-color;
|
60
|
+
|
61
|
+
&:hover a, &:focus a { text-decoration: $crumb-link-decor; }
|
62
|
+
|
63
|
+
a,
|
64
|
+
span {
|
65
|
+
text-transform: $crumb-font-transform;
|
66
|
+
color: $crumb-font-color;
|
67
|
+
}
|
68
|
+
|
69
|
+
// Current is for the link of the current page
|
70
|
+
&.current {
|
71
|
+
cursor: default;
|
72
|
+
color: $crumb-font-color-current;
|
73
|
+
a {
|
74
|
+
cursor: default;
|
75
|
+
color: $crumb-font-color-current;
|
76
|
+
}
|
77
|
+
|
78
|
+
&:hover, &:hover a,
|
79
|
+
&:focus, &:focus a { text-decoration: none; }
|
80
|
+
}
|
81
|
+
|
82
|
+
// Unavailable removed color and link styles so it looks inactive.
|
83
|
+
&.unavailable {
|
84
|
+
color: $crumb-font-color-unavailable;
|
85
|
+
a { color: $crumb-font-color-unavailable; }
|
86
|
+
|
87
|
+
&:hover,
|
88
|
+
&:hover a,
|
89
|
+
&:focus,
|
90
|
+
a:focus {
|
91
|
+
text-decoration: none;
|
92
|
+
color: $crumb-font-color-unavailable;
|
93
|
+
cursor: default;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
&:before {
|
98
|
+
content: "#{$crumb-slash}";
|
99
|
+
color: $crumb-slash-color;
|
100
|
+
margin: 0 $crumb-side-padding;
|
101
|
+
position: relative;
|
102
|
+
top: 1px;
|
103
|
+
}
|
104
|
+
|
105
|
+
&:first-child:before {
|
106
|
+
content: " ";
|
107
|
+
margin: 0;
|
108
|
+
}
|
109
|
+
|
110
|
+
}
|
111
|
+
|
112
|
+
|
113
|
+
@if $include-html-nav-classes != false {
|
114
|
+
|
115
|
+
/* Breadcrumbs */
|
116
|
+
.breadcrumbs {
|
117
|
+
@include crumb-container;
|
118
|
+
@include radius($crumb-radius);
|
119
|
+
|
120
|
+
&>* {
|
121
|
+
@include crumbs;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
}
|
@@ -0,0 +1,89 @@
|
|
1
|
+
//
|
2
|
+
// Button Group Variables
|
3
|
+
//
|
4
|
+
$include-html-button-classes: $include-html-classes !default;
|
5
|
+
|
6
|
+
// Sets the margin for the right side by default, and the left margin if right-to-left direction is used
|
7
|
+
$button-bar-margin-opposite: emCalc(10px) !default;
|
8
|
+
|
9
|
+
//
|
10
|
+
// Button Group Mixins
|
11
|
+
//
|
12
|
+
|
13
|
+
// We use this to add styles for a button group container
|
14
|
+
@mixin button-group-container($styles:true, $float:false) {
|
15
|
+
@if $styles {
|
16
|
+
list-style: none;
|
17
|
+
margin: 0;
|
18
|
+
@include clearfix();
|
19
|
+
}
|
20
|
+
@if $float {
|
21
|
+
float: #{$default-float};
|
22
|
+
margin-#{$opposite-direction}: $button-bar-margin-opposite;
|
23
|
+
& div { overflow: hidden; }
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
// We use this to control styles for button groups
|
28
|
+
@mixin button-group-style($radius:false, $even:false, $float:$default-float) {
|
29
|
+
|
30
|
+
// We use this to control the flow, or remove those styles completely.
|
31
|
+
@if $float {
|
32
|
+
margin: 0 0 0 -1px;
|
33
|
+
float: $float;
|
34
|
+
// Make sure the first child doesn't get the negative margin.
|
35
|
+
&:first-child { margin-#{$default-float}: 0; }
|
36
|
+
}
|
37
|
+
|
38
|
+
// We use these to control left and right radius on first/last buttons in the group.
|
39
|
+
@if $radius == true {
|
40
|
+
&:first-child,
|
41
|
+
&:first-child > a,
|
42
|
+
&:first-child > button,
|
43
|
+
&:first-child > .button { @include side-radius($default-float, $button-radius); }
|
44
|
+
&:last-child,
|
45
|
+
&:last-child > a,
|
46
|
+
&:last-child > button,
|
47
|
+
&:last-child > .button { @include side-radius($opposite-direction, $button-radius); }
|
48
|
+
}
|
49
|
+
@else if $radius {
|
50
|
+
&:first-child,
|
51
|
+
&:first-child > a,
|
52
|
+
&:first-child > button,
|
53
|
+
&:first-child > .button { @include side-radius($default-float, $radius); }
|
54
|
+
&:last-child,
|
55
|
+
&:last-child > a,
|
56
|
+
&:last-child > button,
|
57
|
+
&:last-child > .button { @include side-radius($opposite-direction, $radius); }
|
58
|
+
}
|
59
|
+
|
60
|
+
// We use this to make the buttons even width across their container
|
61
|
+
@if $even {
|
62
|
+
width: percentage((100/$even) / 100);
|
63
|
+
button, .button { width: 100%; }
|
64
|
+
}
|
65
|
+
|
66
|
+
}
|
67
|
+
|
68
|
+
// Only include these CSS classes if $include-html-classes: true
|
69
|
+
@if $include-html-button-classes != false {
|
70
|
+
|
71
|
+
/* Button Groups */
|
72
|
+
.button-group { @include button-group-container;
|
73
|
+
|
74
|
+
&> * { @include button-group-style(); }
|
75
|
+
|
76
|
+
&.radius > * { @include button-group-style($radius:$button-radius, $float:null); }
|
77
|
+
&.round > * { @include button-group-style($radius:$button-round, $float:null); }
|
78
|
+
|
79
|
+
@for $i from 2 through 8 {
|
80
|
+
&.even#{-$i} li { @include button-group-style($even:$i, $float:null); }
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
.button-bar {
|
85
|
+
@include clearfix;
|
86
|
+
.button-group { @include button-group-container($styles:false,$float:true); }
|
87
|
+
}
|
88
|
+
|
89
|
+
}
|
@@ -0,0 +1,227 @@
|
|
1
|
+
//
|
2
|
+
// Button Variables
|
3
|
+
//
|
4
|
+
$include-html-button-classes: $include-html-classes !default;
|
5
|
+
|
6
|
+
// We use these to build padding for buttons.
|
7
|
+
$button-med: emCalc(12px) !default;
|
8
|
+
$button-tny: emCalc(7px) !default;
|
9
|
+
$button-sml: emCalc(9px) !default;
|
10
|
+
$button-lrg: emCalc(16px) !default;
|
11
|
+
|
12
|
+
// We use this to control the display property.
|
13
|
+
$button-display: inline-block !default;
|
14
|
+
$button-margin-bottom: emCalc(20px) !default;
|
15
|
+
|
16
|
+
// We use these to control button text styles.
|
17
|
+
$button-font-family: inherit !default;
|
18
|
+
$button-font-color: #fff !default;
|
19
|
+
$button-font-color-alt: #333 !default;
|
20
|
+
$button-font-med: emCalc(16px) !default;
|
21
|
+
$button-font-tny: emCalc(11px) !default;
|
22
|
+
$button-font-sml: emCalc(13px) !default;
|
23
|
+
$button-font-lrg: emCalc(20px) !default;
|
24
|
+
$button-font-weight: bold !default;
|
25
|
+
$button-font-align: center !default;
|
26
|
+
|
27
|
+
// We use these to control various hover effects.
|
28
|
+
$button-function-factor: 10% !default;
|
29
|
+
|
30
|
+
// We use these to control button border styles.
|
31
|
+
$button-border-width: 1px !default;
|
32
|
+
$button-border-style: solid !default;
|
33
|
+
$button-border-color: darken($primary-color, $button-function-factor) !default;
|
34
|
+
|
35
|
+
// We use this to set the default radius used throughout the core.
|
36
|
+
$button-radius: $global-radius !default;
|
37
|
+
$button-round: $global-rounded !default;
|
38
|
+
|
39
|
+
// We use this to set default opacity for disabled buttons.
|
40
|
+
$button-disabled-opacity: 0.6 !default;
|
41
|
+
|
42
|
+
|
43
|
+
//
|
44
|
+
// Button Mixins
|
45
|
+
//
|
46
|
+
|
47
|
+
// We use this mixin to create a default button base.
|
48
|
+
@mixin button-base($style:true, $display:$button-display) {
|
49
|
+
@if $style {
|
50
|
+
border-style: $button-border-style;
|
51
|
+
border-width: $button-border-width;
|
52
|
+
cursor: pointer;
|
53
|
+
font-family: $button-font-family;
|
54
|
+
font-weight: $button-font-weight;
|
55
|
+
line-height: 1;
|
56
|
+
margin: 0 0 $button-margin-bottom;
|
57
|
+
position: relative;
|
58
|
+
text-decoration: none;
|
59
|
+
text-align: $button-font-align;
|
60
|
+
}
|
61
|
+
@if $display { display: $display; }
|
62
|
+
}
|
63
|
+
|
64
|
+
// We use this mixin to add button size styles
|
65
|
+
@mixin button-size($padding:$button-med, $full-width:false, $is-input:false) {
|
66
|
+
|
67
|
+
// We control which padding styles come through,
|
68
|
+
// these can be turned off by setting $padding:false
|
69
|
+
@if $padding {
|
70
|
+
padding-top: $padding;
|
71
|
+
padding-#{$opposite-direction}: $padding * 2;
|
72
|
+
padding-bottom: $padding + emCalc(1px);
|
73
|
+
padding-#{$default-float}: $padding * 2;
|
74
|
+
|
75
|
+
// We control the font-size based on mixin input.
|
76
|
+
@if $padding == $button-med { font-size: $button-font-med; }
|
77
|
+
@else if $padding == $button-tny { font-size: $button-font-tny; }
|
78
|
+
@else if $padding == $button-sml { font-size: $button-font-sml; }
|
79
|
+
@else if $padding == $button-lrg { font-size: $button-font-lrg; }
|
80
|
+
@else { font-size: $padding - emCalc(2px); }
|
81
|
+
}
|
82
|
+
|
83
|
+
// We can set $full-width:true to remove side padding extend width.
|
84
|
+
@if $full-width {
|
85
|
+
// We still need to check if $padding is set.
|
86
|
+
@if $padding {
|
87
|
+
padding-top: $padding;
|
88
|
+
padding-bottom: $padding + emCalc(1px);
|
89
|
+
} @else if $padding == false {
|
90
|
+
padding-top:0;
|
91
|
+
padding-bottom:0;
|
92
|
+
}
|
93
|
+
padding-right: 0px;
|
94
|
+
padding-left: 0px;
|
95
|
+
width: 100%;
|
96
|
+
}
|
97
|
+
|
98
|
+
// <input>'s and <button>'s take on strange padding. We added this to help fix that.
|
99
|
+
@if $is-input == $button-lrg {
|
100
|
+
padding-top: $is-input + emCalc(.5px);
|
101
|
+
padding-bottom: $is-input + emCalc(.5px);
|
102
|
+
}
|
103
|
+
@else if $is-input {
|
104
|
+
padding-top: $is-input + emCalc(1px);
|
105
|
+
padding-bottom: $is-input;
|
106
|
+
}
|
107
|
+
}
|
108
|
+
|
109
|
+
// We use this mixin to add button color styles
|
110
|
+
@mixin button-style($bg:$primary-color, $radius:false, $disabled:false) {
|
111
|
+
|
112
|
+
// We control which background styles are used,
|
113
|
+
// these can be removed by setting $bg:false
|
114
|
+
@if $bg {
|
115
|
+
// This find the lightness percentage of the background color.
|
116
|
+
$bg-lightness: lightness($bg);
|
117
|
+
|
118
|
+
background-color: $bg;
|
119
|
+
border-color: darken($bg, $button-function-factor);
|
120
|
+
&:hover,
|
121
|
+
&:focus { background-color: darken($bg, $button-function-factor); }
|
122
|
+
|
123
|
+
// We control the text color for you based on the background color.
|
124
|
+
@if $bg-lightness > 70% {
|
125
|
+
color: $button-font-color-alt;
|
126
|
+
&:hover,
|
127
|
+
&:focus { color: $button-font-color-alt; }
|
128
|
+
}
|
129
|
+
@else {
|
130
|
+
color: $button-font-color;
|
131
|
+
&:hover,
|
132
|
+
&:focus { color: $button-font-color; }
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
// We can set $disabled:true to create a disabled transparent button.
|
137
|
+
@if $disabled {
|
138
|
+
cursor: default;
|
139
|
+
opacity: $button-disabled-opacity;
|
140
|
+
-webkit-box-shadow: none;
|
141
|
+
box-shadow: none;
|
142
|
+
&:hover,
|
143
|
+
&:focus { background-color: $bg; }
|
144
|
+
}
|
145
|
+
|
146
|
+
// We can control how much button radius us used.
|
147
|
+
@if $radius == true { @include radius($button-radius); }
|
148
|
+
@else if $radius { @include radius($radius); }
|
149
|
+
|
150
|
+
}
|
151
|
+
|
152
|
+
// We use this to quickly create buttons with a single mixin. As @jaredhardy puts it, "the kitchen sink mixin"
|
153
|
+
@mixin button($padding:$button-med, $bg:$primary-color, $radius:false, $full-width:false, $disabled:false, $is-input:false, $is-prefix:false) {
|
154
|
+
@include button-base;
|
155
|
+
@include button-size($padding, $full-width, $is-input);
|
156
|
+
@include button-style($bg, $radius, $disabled);
|
157
|
+
}
|
158
|
+
|
159
|
+
|
160
|
+
//
|
161
|
+
// Button Classes
|
162
|
+
//
|
163
|
+
|
164
|
+
// Only include these classes if the variable is true, otherwise they'll be left out.
|
165
|
+
@if $include-html-button-classes != false {
|
166
|
+
|
167
|
+
// Default styles applied outside of media query
|
168
|
+
button, .button {
|
169
|
+
@include button-base;
|
170
|
+
@include button-size;
|
171
|
+
@include button-style;
|
172
|
+
|
173
|
+
&.secondary { @include button-style($bg:$secondary-color); }
|
174
|
+
&.success { @include button-style($bg:$success-color); }
|
175
|
+
&.alert { @include button-style($bg:$alert-color); }
|
176
|
+
|
177
|
+
&.large { @include button-size($padding:$button-lrg); }
|
178
|
+
&.small { @include button-size($padding:$button-sml); }
|
179
|
+
&.tiny { @include button-size($padding:$button-tny); }
|
180
|
+
&.expand { @include button-size($padding:null,$full-width:true); }
|
181
|
+
|
182
|
+
&.left-align { text-align: left; text-indent: emCalc(12px); }
|
183
|
+
&.right-align { text-align: right; padding-right: emCalc(12px); }
|
184
|
+
|
185
|
+
&.disabled, &[disabled] { @include button-style($bg:$primary-color, $disabled:true);
|
186
|
+
&.secondary { @include button-style($bg:$secondary-color, $disabled:true); }
|
187
|
+
&.success { @include button-style($bg:$success-color, $disabled:true); }
|
188
|
+
&.alert { @include button-style($bg:$alert-color, $disabled:true); }
|
189
|
+
}
|
190
|
+
|
191
|
+
}
|
192
|
+
|
193
|
+
button, .button {
|
194
|
+
@include button-size($padding:false, $is-input:$button-med);
|
195
|
+
&.tiny { @include button-size($padding:false, $is-input:$button-tny); }
|
196
|
+
&.small { @include button-size($padding:false, $is-input:$button-sml); }
|
197
|
+
&.large { @include button-size($padding:false, $is-input:$button-lrg); }
|
198
|
+
}
|
199
|
+
|
200
|
+
// Styles for any browser or device that support media queries
|
201
|
+
@media only screen {
|
202
|
+
|
203
|
+
button, .button {
|
204
|
+
@include inset-shadow();
|
205
|
+
@include single-transition(background-color);
|
206
|
+
|
207
|
+
&.large { @include button-size($padding:false, $full-width:false); }
|
208
|
+
&.small { @include button-size($padding:false, $full-width:false); }
|
209
|
+
&.tiny { @include button-size($padding:false, $full-width:false); }
|
210
|
+
|
211
|
+
&.radius { @include button-style($bg:false, $radius:true); }
|
212
|
+
&.round { @include button-style($bg:false, $radius:$button-round); }
|
213
|
+
}
|
214
|
+
|
215
|
+
}
|
216
|
+
|
217
|
+
// Additional styles for screens larger than 768px
|
218
|
+
@media #{$small} {
|
219
|
+
|
220
|
+
button, .button {
|
221
|
+
@include button-base($style:false, $display:inline-block);
|
222
|
+
@include button-size($padding:false, $full-width:false);
|
223
|
+
}
|
224
|
+
|
225
|
+
}
|
226
|
+
|
227
|
+
}
|