cactu 0.1.2 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +10 -15
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +1 -1
- data/{LICENSE.txt → LICENSE} +1 -1
- data/README.md +46 -16
- data/Rakefile +9 -0
- data/assets/stylesheets/base/_blocks.scss +24 -0
- data/assets/stylesheets/base/_global-variables.scss +62 -0
- data/assets/stylesheets/base/_reboot.scss +309 -0
- data/assets/stylesheets/cactu.scss +46 -0
- data/assets/stylesheets/components/_alerts.scss +48 -0
- data/assets/stylesheets/components/_buttons.scss +82 -0
- data/assets/stylesheets/components/_collapse.scss +84 -0
- data/assets/stylesheets/components/_dropdowns.scss +172 -0
- data/assets/stylesheets/components/_forms.scss +158 -0
- data/assets/stylesheets/components/_grids.scss +95 -0
- data/assets/stylesheets/components/_lists.scss +75 -0
- data/assets/stylesheets/components/_modals.scss +124 -0
- data/assets/stylesheets/components/_navbars.scss +190 -0
- data/assets/stylesheets/components/_navs.scss +52 -0
- data/assets/stylesheets/components/_paginations.scss +76 -0
- data/assets/stylesheets/components/_tables.scss +49 -0
- data/assets/stylesheets/components/_tooltips.scss +138 -0
- data/assets/stylesheets/elements/_button.scss +94 -0
- data/assets/stylesheets/elements/_code.scss +75 -0
- data/assets/stylesheets/elements/_icon.scss +66 -0
- data/assets/stylesheets/elements/_image.scss +33 -0
- data/assets/stylesheets/elements/_typography.scss +130 -0
- data/assets/stylesheets/functions/_colors.scss +40 -0
- data/assets/stylesheets/functions/_strings.scss +14 -0
- data/assets/stylesheets/mixins/_alerts.scss +18 -0
- data/assets/stylesheets/mixins/_breakpoints.scss +93 -0
- data/assets/stylesheets/mixins/_buttons.scss +96 -0
- data/assets/stylesheets/mixins/_forms.scss +44 -0
- data/assets/stylesheets/mixins/_grid.scss +18 -0
- data/assets/stylesheets/mixins/_hover.scss +27 -0
- data/assets/stylesheets/mixins/_icons.scss +22 -0
- data/assets/stylesheets/mixins/_navbar.scss +60 -0
- data/assets/stylesheets/mixins/_positions.scss +12 -0
- data/assets/stylesheets/mixins/_transition.scss +16 -0
- data/assets/stylesheets/utilities/_classes.scss +69 -0
- data/assets/stylesheets/utilities/_syntax.scss +81 -0
- data/cactu.gemspec +15 -15
- data/lib/cactu.rb +40 -12
- data/lib/cactu/engine.rb +11 -3
- data/lib/cactu/version.rb +1 -1
- metadata +123 -110
- data/app/assets/stylesheets/_cactu.scss +0 -15
- data/app/assets/stylesheets/config/_variables.scss +0 -27
- data/app/assets/stylesheets/functions/_grid.scss +0 -32
- data/app/assets/stylesheets/mixins/_fonts.scss +0 -13
- data/app/assets/stylesheets/mixins/_grid.scss +0 -81
- data/app/assets/stylesheets/mixins/_menu.scss +0 -47
- data/app/assets/stylesheets/ui/_base.scss +0 -53
- data/app/assets/stylesheets/ui/_buttons.scss +0 -13
- data/app/assets/stylesheets/ui/_forms.scss +0 -3
- data/app/assets/stylesheets/ui/_images.scss +0 -3
- data/app/assets/stylesheets/ui/_menus.scss +0 -4
- data/app/assets/stylesheets/ui/_tables.scss +0 -3
- data/app/assets/stylesheets/ui/_text.scss +0 -71
- data/bin/cactu +0 -6
- data/lib/cactu/generator.rb +0 -80
- data/test/cactu_app/.gitignore +0 -16
- data/test/cactu_app/Gemfile +0 -49
- data/test/cactu_app/README.rdoc +0 -28
- data/test/cactu_app/Rakefile +0 -6
- data/test/cactu_app/app/assets/images/.keep +0 -0
- data/test/cactu_app/app/assets/javascripts/application.js +0 -16
- data/test/cactu_app/app/assets/stylesheets/application.css.scss +0 -16
- data/test/cactu_app/app/assets/stylesheets/test/_test.css.scss +0 -10
- data/test/cactu_app/app/assets/stylesheets/test/config/_responsive_large.css.scss +0 -7
- data/test/cactu_app/app/assets/stylesheets/test/config/_responsive_medium.css.scss +0 -7
- data/test/cactu_app/app/assets/stylesheets/test/config/_responsive_short.css.scss +0 -3
- data/test/cactu_app/app/assets/stylesheets/test/config/_variables.css.scss +0 -7
- data/test/cactu_app/app/assets/stylesheets/test/pages/_home.css.scss +0 -2
- data/test/cactu_app/app/assets/stylesheets/test/ui/_anchors.css.scss +0 -0
- data/test/cactu_app/app/assets/stylesheets/test/ui/_base.css.scss +0 -0
- data/test/cactu_app/app/assets/stylesheets/test/ui/_navigations.css.scss +0 -3
- data/test/cactu_app/app/assets/stylesheets/test/ui/_text.css.scss +0 -1
- data/test/cactu_app/app/controllers/application_controller.rb +0 -5
- data/test/cactu_app/app/controllers/concerns/.keep +0 -0
- data/test/cactu_app/app/controllers/home_controller.rb +0 -5
- data/test/cactu_app/app/controllers/usage_controller.rb +0 -13
- data/test/cactu_app/app/helpers/application_helper.rb +0 -2
- data/test/cactu_app/app/mailers/.keep +0 -0
- data/test/cactu_app/app/models/.keep +0 -0
- data/test/cactu_app/app/models/concerns/.keep +0 -0
- data/test/cactu_app/app/views/home/index.html.haml +0 -7
- data/test/cactu_app/app/views/layouts/application.html.haml +0 -20
- data/test/cactu_app/app/views/usage/base.html.haml +0 -19
- data/test/cactu_app/app/views/usage/components.html.haml +0 -4
- data/test/cactu_app/app/views/usage/started.html.haml +0 -4
- data/test/cactu_app/bin/bundle +0 -3
- data/test/cactu_app/bin/rails +0 -4
- data/test/cactu_app/bin/rake +0 -4
- data/test/cactu_app/config.ru +0 -4
- data/test/cactu_app/config/application.rb +0 -23
- data/test/cactu_app/config/boot.rb +0 -4
- data/test/cactu_app/config/database.yml +0 -25
- data/test/cactu_app/config/environment.rb +0 -5
- data/test/cactu_app/config/environments/development.rb +0 -29
- data/test/cactu_app/config/environments/production.rb +0 -80
- data/test/cactu_app/config/environments/test.rb +0 -36
- data/test/cactu_app/config/initializers/backtrace_silencers.rb +0 -7
- data/test/cactu_app/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/cactu_app/config/initializers/inflections.rb +0 -16
- data/test/cactu_app/config/initializers/mime_types.rb +0 -5
- data/test/cactu_app/config/initializers/secret_token.rb +0 -12
- data/test/cactu_app/config/initializers/session_store.rb +0 -3
- data/test/cactu_app/config/initializers/wrap_parameters.rb +0 -14
- data/test/cactu_app/config/locales/en.yml +0 -23
- data/test/cactu_app/config/routes.rb +0 -6
- data/test/cactu_app/db/seeds.rb +0 -7
- data/test/cactu_app/lib/assets/.keep +0 -0
- data/test/cactu_app/lib/tasks/.keep +0 -0
- data/test/cactu_app/log/.keep +0 -0
- data/test/cactu_app/public/404.html +0 -58
- data/test/cactu_app/public/422.html +0 -58
- data/test/cactu_app/public/500.html +0 -57
- data/test/cactu_app/public/favicon.ico +0 -0
- data/test/cactu_app/public/robots.txt +0 -5
- data/test/cactu_app/test/controllers/.keep +0 -0
- data/test/cactu_app/test/fixtures/.keep +0 -0
- data/test/cactu_app/test/helpers/.keep +0 -0
- data/test/cactu_app/test/integration/.keep +0 -0
- data/test/cactu_app/test/mailers/.keep +0 -0
- data/test/cactu_app/test/models/.keep +0 -0
- data/test/cactu_app/test/test_helper.rb +0 -15
- data/test/cactu_app/vendor/assets/javascripts/.keep +0 -0
- data/test/cactu_app/vendor/assets/stylesheets/.keep +0 -0
@@ -0,0 +1,66 @@
|
|
1
|
+
//
|
2
|
+
// Icon
|
3
|
+
// --------------------------------------------------
|
4
|
+
|
5
|
+
|
6
|
+
// Variables
|
7
|
+
//
|
8
|
+
$icon-color: $text-color !default;
|
9
|
+
|
10
|
+
|
11
|
+
.menu-icon,
|
12
|
+
.close-icon {
|
13
|
+
display: block;
|
14
|
+
width: 22px;
|
15
|
+
|
16
|
+
&:before,
|
17
|
+
&:after {
|
18
|
+
@extend %shape-block;
|
19
|
+
height: 2px;
|
20
|
+
margin: 5px 0;
|
21
|
+
background-color: $icon-color;
|
22
|
+
@include transition($transition-all);
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
.close-icon {
|
27
|
+
&:before {
|
28
|
+
transform: rotate(45deg);
|
29
|
+
margin-top: 5px;
|
30
|
+
}
|
31
|
+
|
32
|
+
&:after {
|
33
|
+
transform: rotate(-45deg);
|
34
|
+
margin-top: -7px;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
.chevron-down-icon {
|
39
|
+
position: absolute;
|
40
|
+
right: 8px;
|
41
|
+
top: 16px;
|
42
|
+
display: inline-block;
|
43
|
+
width: 15px;
|
44
|
+
height: 15px;
|
45
|
+
margin: -5px 0;
|
46
|
+
background: none;
|
47
|
+
|
48
|
+
&:before,
|
49
|
+
&:after {
|
50
|
+
content: "";
|
51
|
+
display: block;
|
52
|
+
width: 50%;
|
53
|
+
height: 2px;
|
54
|
+
margin-top: 3px;
|
55
|
+
background-color: $icon-color;
|
56
|
+
}
|
57
|
+
|
58
|
+
&:before {
|
59
|
+
transform: rotate(45deg);
|
60
|
+
}
|
61
|
+
|
62
|
+
&:after {
|
63
|
+
transform: rotate(-45deg);
|
64
|
+
margin-left: -3px;
|
65
|
+
}
|
66
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
//
|
2
|
+
// Image
|
3
|
+
// --------------------------------------------------
|
4
|
+
|
5
|
+
|
6
|
+
$image-padding: .25rem !default;
|
7
|
+
$image-radius: $radius !default;
|
8
|
+
$image-border: $border-base !default;
|
9
|
+
$image-background: $white !default;
|
10
|
+
|
11
|
+
|
12
|
+
img {
|
13
|
+
max-width: 100%;
|
14
|
+
height: auto;
|
15
|
+
vertical-align: middle;
|
16
|
+
border-style: none; // Remove the border on images inside links in IE 10-.
|
17
|
+
}
|
18
|
+
|
19
|
+
svg:not(:root) {
|
20
|
+
overflow: hidden; // Hide the overflow in IE
|
21
|
+
}
|
22
|
+
|
23
|
+
figcaption {
|
24
|
+
margin-top: .5rem;
|
25
|
+
font-size: 90%;
|
26
|
+
}
|
27
|
+
|
28
|
+
.image-edge {
|
29
|
+
padding: $image-padding;
|
30
|
+
border-radius: $image-radius;
|
31
|
+
border: $image-border;
|
32
|
+
background-color: $image-background;
|
33
|
+
}
|
@@ -0,0 +1,130 @@
|
|
1
|
+
//
|
2
|
+
// Type
|
3
|
+
// --------------------------------------------------
|
4
|
+
|
5
|
+
|
6
|
+
// Variables
|
7
|
+
//
|
8
|
+
$headings-font-weight: $font-weight-bold !default;
|
9
|
+
$headings-margins: 1rem 0 .5rem !default;
|
10
|
+
$h1-font-size: 2.8125rem !default;
|
11
|
+
$h2-font-size: 2.125rem !default;
|
12
|
+
$h3-font-size: 1.75rem !default;
|
13
|
+
$h4-font-size: 1.5rem !default;
|
14
|
+
$h5-font-size: 1.25rem !default;
|
15
|
+
$h6-font-size: 1rem !default;
|
16
|
+
$link-color: $blue !default;
|
17
|
+
$link-decoration: none !default;
|
18
|
+
$link-hover-color: darken($link-color, 10%) !default;
|
19
|
+
$link-hover-decoration: underline !default;
|
20
|
+
$link-transition: color $speed ease-in-out, text-decoration $speed ease-in-out !default;
|
21
|
+
|
22
|
+
|
23
|
+
// Anchors
|
24
|
+
//
|
25
|
+
a {
|
26
|
+
color: $link-color;
|
27
|
+
text-decoration: $link-decoration;
|
28
|
+
background-color: transparent;
|
29
|
+
@include transition($link-transition);
|
30
|
+
-webkit-text-decoration-skip: objects; // Remove gaps in links underline in iOS 8+ and Safari 8+.
|
31
|
+
|
32
|
+
@include hover-focus {
|
33
|
+
color: $link-hover-color;
|
34
|
+
text-decoration: $link-hover-decoration;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
a:not([href]):not([tabindex]) {
|
39
|
+
color: inherit;
|
40
|
+
text-decoration: none;
|
41
|
+
|
42
|
+
@include hover-focus {
|
43
|
+
color: inherit;
|
44
|
+
text-decoration: none;
|
45
|
+
}
|
46
|
+
|
47
|
+
&:focus {
|
48
|
+
outline: 0;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
// Abbreviation
|
53
|
+
//
|
54
|
+
abbr[title],
|
55
|
+
abbr[data-original-title] {
|
56
|
+
text-decoration: underline;
|
57
|
+
text-decoration: underline dotted;
|
58
|
+
cursor: help;
|
59
|
+
border-bottom: 0;
|
60
|
+
}
|
61
|
+
|
62
|
+
address {
|
63
|
+
margin-bottom: 1rem;
|
64
|
+
font-style: normal;
|
65
|
+
line-height: inherit;
|
66
|
+
}
|
67
|
+
|
68
|
+
blockquote {
|
69
|
+
margin: 0 0 1rem;
|
70
|
+
font-size: 1.25rem;
|
71
|
+
}
|
72
|
+
|
73
|
+
cite {
|
74
|
+
display: block;
|
75
|
+
font-size: 80%;
|
76
|
+
color: $text-color + 50;
|
77
|
+
|
78
|
+
&:before {
|
79
|
+
content: "\2014 \00A0";
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
b,
|
84
|
+
strong {
|
85
|
+
font-weight: bolder;
|
86
|
+
}
|
87
|
+
|
88
|
+
small {
|
89
|
+
font-size: .8em; // 80%
|
90
|
+
}
|
91
|
+
|
92
|
+
span {
|
93
|
+
font-style: inherit;
|
94
|
+
font-weight: inherit;
|
95
|
+
}
|
96
|
+
|
97
|
+
sub,
|
98
|
+
sup {
|
99
|
+
position: relative;
|
100
|
+
font-size: .75em; // 75%
|
101
|
+
line-height: 0;
|
102
|
+
vertical-align: baseline;
|
103
|
+
}
|
104
|
+
|
105
|
+
sub { bottom: -.25em; }
|
106
|
+
sup { top: -.5em; }
|
107
|
+
|
108
|
+
p { margin-bottom: .7rem; }
|
109
|
+
|
110
|
+
|
111
|
+
// Headings
|
112
|
+
//
|
113
|
+
h1, h2, h3, h4, h5, h6,
|
114
|
+
.h1, .h2, .h3, .h4, .h5, .h6 {
|
115
|
+
margin: $headings-margins;
|
116
|
+
font-weight: $headings-font-weight;
|
117
|
+
}
|
118
|
+
|
119
|
+
h1, .h1 { font-size: $h1-font-size; }
|
120
|
+
h2, .h2 { font-size: $h2-font-size; }
|
121
|
+
h3, .h3 { font-size: $h3-font-size; }
|
122
|
+
h4, .h4 { font-size: $h4-font-size; }
|
123
|
+
h5, .h5 { font-size: $h5-font-size; }
|
124
|
+
h6, .h6 { font-size: $h6-font-size; }
|
125
|
+
|
126
|
+
// Alignment
|
127
|
+
//
|
128
|
+
.text-left { text-align: left; }
|
129
|
+
.text-centered { text-align: center; }
|
130
|
+
.text-right { text-align: right; }
|
@@ -0,0 +1,40 @@
|
|
1
|
+
//
|
2
|
+
// Colors function
|
3
|
+
// --------------------------------------------------
|
4
|
+
|
5
|
+
|
6
|
+
// Variables
|
7
|
+
//
|
8
|
+
$theme-color-interval: 8% !default;
|
9
|
+
$yiq-text-dark: $text-color !default;
|
10
|
+
$yiq-text-light: $white !default;
|
11
|
+
$yiq-contrasted-threshold: 150 !default;
|
12
|
+
|
13
|
+
|
14
|
+
@function theme-color-level($color: $gray-300, $level: 0) {
|
15
|
+
$color-base: if($level > 0, $black, $white);
|
16
|
+
$level: abs($level);
|
17
|
+
|
18
|
+
@return mix($color-base, $color, $level * $theme-color-interval);
|
19
|
+
}
|
20
|
+
|
21
|
+
|
22
|
+
// Color contrast
|
23
|
+
// Credit: Bootstrap functions
|
24
|
+
// https://github.com/twbs/bootstrap/blob/v4-dev/scss/_functions.scss
|
25
|
+
// v4.1.3
|
26
|
+
// License: MIT
|
27
|
+
//
|
28
|
+
@function color-yiq($color) {
|
29
|
+
$r: red($color);
|
30
|
+
$g: green($color);
|
31
|
+
$b: blue($color);
|
32
|
+
|
33
|
+
$yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
|
34
|
+
|
35
|
+
@if ($yiq >= $yiq-contrasted-threshold) {
|
36
|
+
@return $yiq-text-dark;
|
37
|
+
} @else {
|
38
|
+
@return $yiq-text-light;
|
39
|
+
}
|
40
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
//
|
2
|
+
// Strings function
|
3
|
+
// --------------------------------------------------
|
4
|
+
|
5
|
+
|
6
|
+
@function str-replace($string, $search, $replace: "") {
|
7
|
+
$index: str-index($string, $search);
|
8
|
+
|
9
|
+
@if $index {
|
10
|
+
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
|
11
|
+
}
|
12
|
+
|
13
|
+
@return $string;
|
14
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
//
|
2
|
+
// Alerts mixins
|
3
|
+
// --------------------------------------------------
|
4
|
+
|
5
|
+
|
6
|
+
@mixin alert-theme($background, $border, $color) {
|
7
|
+
color: $color;
|
8
|
+
border: $border-width solid $border;
|
9
|
+
background-color: $background;
|
10
|
+
|
11
|
+
hr {
|
12
|
+
background-color: darken($border, 5%);
|
13
|
+
}
|
14
|
+
|
15
|
+
.alert-link {
|
16
|
+
color: darken($color, 70%);
|
17
|
+
}
|
18
|
+
}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
//
|
2
|
+
// Breakpoints mixins
|
3
|
+
// --------------------------------------------------
|
4
|
+
|
5
|
+
|
6
|
+
// Media of at least the minimum breakpoint width
|
7
|
+
// Valid only if $min-size > 0
|
8
|
+
@mixin breakpoint-min($min-size: 0) {
|
9
|
+
@if $min-size > 0 {
|
10
|
+
@media screen and (min-width: $min-size) {
|
11
|
+
@content;
|
12
|
+
}
|
13
|
+
} @else {
|
14
|
+
@content;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
// Media of at most the maximum breakpoint width.
|
19
|
+
// Valid only if $max-size > 0
|
20
|
+
@mixin breakpoint-max($max-size: 0) {
|
21
|
+
@if $max-size > 0 {
|
22
|
+
@media screen and (max-width: $max-size) {
|
23
|
+
@content;
|
24
|
+
}
|
25
|
+
} @else {
|
26
|
+
@content;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
// Media that spans multiple breakpoint widths.
|
31
|
+
// Valid only with 2 values and just if $max-size > $min-size
|
32
|
+
@mixin breakpoint-between($min-size: 0, $max-size: 0) {
|
33
|
+
@if $min-size < $max-size and $max-size > $min-size {
|
34
|
+
@media (min-width: $min-size) and (max-width: $max-size) {
|
35
|
+
@content;
|
36
|
+
}
|
37
|
+
} @else {
|
38
|
+
@content;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
// Specific media queriues for this framework.
|
43
|
+
// If you need a different breakpoints, use:
|
44
|
+
// breakpoint-min, breakpoint-max or breakpoint-between
|
45
|
+
//
|
46
|
+
// max 575px
|
47
|
+
@mixin breakpoint-cellphone {
|
48
|
+
@include breakpoint-max($cellphone-size - 1) {
|
49
|
+
@content;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
// 576px - 767px
|
54
|
+
@mixin breakpoint-cellphone-tablet {
|
55
|
+
@include breakpoint-between($cellphone-size, $tablet-size - 1) {
|
56
|
+
@content;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
// 768px - 959px
|
61
|
+
@mixin breakpoint-tablet {
|
62
|
+
@include breakpoint-between($tablet-size, $small-desktop-size - 1) {
|
63
|
+
@content;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
// 960px - 1199px
|
68
|
+
@mixin breakpoint-small-desktop {
|
69
|
+
@include breakpoint-between($small-desktop-size, $medium-desktop-size - 1) {
|
70
|
+
@content;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
// 1200px - 1343px
|
75
|
+
@mixin breakpoint-medium-desktop {
|
76
|
+
@include breakpoint-between($medium-desktop-size, $large-desktop-size - 1) {
|
77
|
+
@content;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
// min 1344px
|
82
|
+
@mixin breakpoint-large-desktop {
|
83
|
+
@include breakpoint-min($large-desktop-size) {
|
84
|
+
@content;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
// Specia: 576px - 1199px
|
89
|
+
@mixin breakpoint-cellphone-medium-desktop {
|
90
|
+
@include breakpoint-between($cellphone-size, $medium-desktop-size - 1) {
|
91
|
+
@content;
|
92
|
+
}
|
93
|
+
}
|
@@ -0,0 +1,96 @@
|
|
1
|
+
//
|
2
|
+
// Buttons mixins
|
3
|
+
// --------------------------------------------------
|
4
|
+
|
5
|
+
|
6
|
+
// Button sizes
|
7
|
+
@mixin button-size($padding-y: .375rem, $padding-x: .75rem, $font-size: 1rem, $line-height: $line-height, $border-radius: $radius) {
|
8
|
+
padding: $padding-y $padding-x;
|
9
|
+
font-size: $font-size;
|
10
|
+
line-height: $line-height;
|
11
|
+
border-radius: $border-radius;
|
12
|
+
}
|
13
|
+
|
14
|
+
|
15
|
+
// Button theme
|
16
|
+
@mixin button-theme($background: $gray-200) {
|
17
|
+
$focus-box-shadow: 0 0 0 $outline-width darken($background, 15%);
|
18
|
+
$active-box-shadow: inset 0 3px 5px rgba($black, .125);
|
19
|
+
|
20
|
+
color: color-yiq($background);
|
21
|
+
background-color: $background;
|
22
|
+
|
23
|
+
&:hover {
|
24
|
+
color: color-yiq($background);
|
25
|
+
background-color: darken($background, 10%);
|
26
|
+
}
|
27
|
+
|
28
|
+
&:focus,
|
29
|
+
&.focus {
|
30
|
+
color: color-yiq($background);
|
31
|
+
box-shadow: $focus-box-shadow;
|
32
|
+
}
|
33
|
+
|
34
|
+
&.disabled,
|
35
|
+
&:disabled {
|
36
|
+
&:hover,
|
37
|
+
&:focus {
|
38
|
+
color: color-yiq($background);
|
39
|
+
background-color: $background;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
&:not(:disabled):not(.disabled):active,
|
44
|
+
&:not(:disabled):not(.disabled).active {
|
45
|
+
box-shadow: $active-box-shadow;
|
46
|
+
background-color: darken($background, 10%);
|
47
|
+
|
48
|
+
&:focus {
|
49
|
+
box-shadow: $focus-box-shadow, $active-box-shadow;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
// Button contoured
|
55
|
+
@mixin button-outline($color: $text-color) {
|
56
|
+
$focus-box-shadow: 0 0 0 $outline-width lighten($color, 30%);
|
57
|
+
$active-box-shadow: inset 0 3px 5px rgba($black, .125);
|
58
|
+
|
59
|
+
color: $color;
|
60
|
+
border-color: $color;
|
61
|
+
background-color: transparent;
|
62
|
+
|
63
|
+
&:hover {
|
64
|
+
color: color-yiq($color);
|
65
|
+
border-color: $color;
|
66
|
+
background-color: $color;
|
67
|
+
}
|
68
|
+
|
69
|
+
&:focus,
|
70
|
+
&.focus {
|
71
|
+
color: $color;
|
72
|
+
box-shadow: $focus-box-shadow;
|
73
|
+
|
74
|
+
&:hover { color: color-yiq($color); }
|
75
|
+
}
|
76
|
+
|
77
|
+
&.disabled,
|
78
|
+
&:disabled {
|
79
|
+
&:hover,
|
80
|
+
&:focus {
|
81
|
+
color: $color;
|
82
|
+
background-color: transparent;
|
83
|
+
}
|
84
|
+
}
|
85
|
+
|
86
|
+
&:not(:disabled):not(.disabled):active,
|
87
|
+
&:not(:disabled):not(.disabled).active {
|
88
|
+
color: color-yiq($color);
|
89
|
+
background-color: $color;
|
90
|
+
box-shadow: $active-box-shadow;
|
91
|
+
|
92
|
+
&:focus {
|
93
|
+
box-shadow: $focus-box-shadow, $active-box-shadow;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|