bbuttons 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.mkdn ADDED
@@ -0,0 +1,4 @@
1
+ bbuttons
2
+ ========
3
+
4
+ Small, palpable button mixin.
data/lib/bbuttons.rb ADDED
@@ -0,0 +1 @@
1
+ Compass::Frameworks.register("bbuttons", :path => "#{File.dirname(__FILE__)}/..")
@@ -0,0 +1,214 @@
1
+ // Bbuttons - A palpable lightweight button mixin
2
+ // Taylor Stackpole
3
+ // July 6, 2013
4
+
5
+ @mixin linear-gradient($start, $end) {
6
+ background-color: $end;
7
+ background-image: -webkit-gradient(linear, left top, left bottom, from($start), to($end));
8
+ background-image: -webkit-linear-gradient(top, $start, $end);
9
+ background-image: -moz-linear-gradient(top, $start, $end);
10
+ background-image: -ms-linear-gradient(top, $start, $end);
11
+ background-image: -o-linear-gradient(top, $start, $end);
12
+ background-image: linear-gradient(top, $start, $end);
13
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='$start', EndColorStr='$end');
14
+ }
15
+ @mixin radial-gradient($start, $end){
16
+ background: linear-gradient(#000, #FFF);
17
+ }
18
+
19
+ @mixin left($color: rgba(0,0,0,0.3)) {
20
+ border: {
21
+ right: 1px solid $color;
22
+ top-right-radius: 0;
23
+ bottom-right-radius: 0;
24
+ }
25
+ }
26
+ @mixin mid($color: rgba(255, 255, 255, 0.4)) {
27
+ border: {
28
+ left: 1px solid lighten($color, 25%);
29
+ right: 1px solid rgba(0,0,0,0.3);
30
+ radius: 0;
31
+ }
32
+ }
33
+ @mixin right($color: rgba(255, 255, 255, 0.4)) {
34
+ border: {
35
+ left: 1px solid lighten($color, 25%);
36
+ bottom-left-radius: 0;
37
+ top-left-radius: 0;
38
+ }
39
+ }
40
+
41
+ @mixin bsimple(
42
+ $color: #ccc,
43
+ $font: #333,
44
+ $shadow: #FFF
45
+ ) {
46
+ background: $color;
47
+ background-repeat: repeat-x;
48
+ border: none;
49
+ border-radius: 3px;
50
+ // border: 1px solid rgba(0,0,0,0.1);
51
+ color: $font;
52
+ font: {
53
+ size: 24px;
54
+ family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
55
+ }
56
+ padding: 8px 14px;
57
+ text-shadow: 0 0 1px $shadow;
58
+ @include linear-gradient($color, darken($color, 25%));
59
+ &:active {
60
+ text-shadow: 0 0 1px shadow;
61
+ @include linear-gradient(darken($color, 5%), $color);
62
+ }
63
+ }
64
+ @mixin bsuper(
65
+ $color: #999,
66
+ $font: #333,
67
+ $shadow: 0 0 3px white
68
+ ) {
69
+ background: $color;
70
+ border: none;
71
+ border-radius: 2px;
72
+ color: $font;
73
+ font: {
74
+ weight: normal;
75
+ }
76
+ padding: 3px 8px;
77
+ text-shadow: $shadow;
78
+ }
79
+
80
+ $blue-bbutton: #545FDD;
81
+ // $yellow-bbutton: #FFAF05;
82
+ $yellow-bbutton: #e5d400;
83
+ // $green-bbutton: #27D505;
84
+ $green-bbutton: #91df97;
85
+ $teal-bbutton: #0FE5D4;
86
+ // $red-bbutton: #FF4242;
87
+ $red-bbutton: #ee6868;
88
+
89
+ #bbuttons {
90
+ }
91
+ button.bsimple {
92
+ @include bsimple();
93
+ &.blue {
94
+ background: $blue-bbutton;
95
+ color: white;
96
+ text-shadow: 0 0 2px darken($blue-bbutton, 15%);
97
+ @include linear-gradient($blue-bbutton, darken($blue-bbutton, 30%));
98
+ &:active {
99
+ @include linear-gradient(darken($blue-bbutton, 5%), darken($blue-bbutton, 20%));
100
+ }
101
+ }
102
+ &.green {
103
+ background: $green-bbutton;
104
+ color: white;
105
+ text-shadow: 0 0 2px darken($green-bbutton, 15%);
106
+ @include linear-gradient($green-bbutton, darken($green-bbutton, 25%));
107
+ &:active {
108
+ @include linear-gradient(darken($green-bbutton, 5%), darken($green-bbutton, 10%));
109
+ }
110
+ }
111
+ &.yellow {
112
+ background: $yellow-bbutton;
113
+ color: white;
114
+ text-shadow: 0 0 2px darken($yellow-bbutton, 15%);
115
+ @include linear-gradient($yellow-bbutton, darken($yellow-bbutton, 10%));
116
+ &:active {
117
+ @include linear-gradient(darken($yellow-bbutton, 5%), $yellow-bbutton);
118
+ }
119
+ }
120
+ &.teal {
121
+ background: $teal-bbutton;
122
+ color: white;
123
+ text-shadow: 0 0 2px darken($teal-bbutton, 15%);
124
+ @include linear-gradient($teal-bbutton, darken($teal-bbutton, 15%));
125
+ &:active {
126
+ @include linear-gradient(darken($teal-bbutton, 5%), $teal-bbutton);
127
+ }
128
+ }
129
+ &.red {
130
+ background: $red-bbutton;
131
+ color: white;
132
+ text-shadow: 0 0 2px darken($red-bbutton, 15%);
133
+ @include linear-gradient($red-bbutton, darken($red-bbutton, 20%));
134
+ &:active {
135
+ @include linear-gradient(darken($red-bbutton, 20%), $red-bbutton);
136
+ }
137
+ }
138
+ &.small {
139
+ border-radius: 2px;
140
+ font: {
141
+ size: 16px;
142
+ weight: normal;
143
+ }
144
+ padding: 2px 10px;
145
+ }
146
+ &.large {
147
+ border-radius: 4px;
148
+ font-size: 32px;
149
+ padding: 12px 19px;
150
+ + ul {
151
+ width: 200px;
152
+ }
153
+ }
154
+ &.left {
155
+ @include left();
156
+ float: left;
157
+ }
158
+ &.right {
159
+ @include right();
160
+ float: left;
161
+ }
162
+ &.mid {
163
+ @include mid();
164
+ float: left;
165
+ }
166
+ }
167
+
168
+ // set of buttons
169
+ .button-set {
170
+ width: auto;
171
+ display: inline-block;
172
+ height: auto;
173
+ }
174
+ // Button dropdown
175
+ .button-drop {
176
+ display: inline-block;
177
+ ul {
178
+ position: fixed;
179
+ display: none;
180
+ background: rgb(240, 240, 240);
181
+ border-radius: 5px;
182
+ box-shadow: 0 1px 3px 1px rgba(0,0,0,0.4);
183
+ list-style: none;
184
+ margin-left: 0;
185
+ margin-top: 3px;
186
+ width: 150px;
187
+ li {
188
+ padding: 5px 10px 5px 10px;
189
+ font-size: 16px;
190
+ line-height: 19px;
191
+ a {
192
+ text-decoration: none;
193
+ }
194
+ &.heads-up {
195
+ background: rgba(0,0,0,0) !important;
196
+ // border-bottom: 1px solid rgba(0,0,0,0.2);
197
+ padding: {
198
+ top: 7px;
199
+ bottom: 7px;
200
+ }
201
+ box-shadow: 0 0px 3px 0px rgba(0,0,0,0.4);
202
+ }
203
+ &:hover {
204
+ background: rgba(0,0,0,0.15);
205
+ }
206
+ &:first-child {
207
+ border-radius: 5px 5px 0 0;
208
+ }
209
+ &:last-child {
210
+ border-radius: 0 0 5px 5px;
211
+ }
212
+ }
213
+ }
214
+ }
@@ -0,0 +1,4 @@
1
+ // _bbuttons.scss - Taylor Stackpole
2
+ // Import -------------------------------------------
3
+
4
+ @import "bbuttons";
@@ -0,0 +1,230 @@
1
+ <!-- The structure of a dropdown should start with a div -->
2
+ <!-- The div needs a class 'button-drop' -->
3
+
4
+ <!-- Large bsimple button-drop example -->
5
+ <div class="button-drop">
6
+ <!-- You MUST give the button an id-->
7
+ <button id="one" class="bsimple large">
8
+ Dropdown
9
+ </button>
10
+ <!-- From here, we have a simple ul tag-->
11
+ <ul class="drop">
12
+ <!-- The built-in 'heads-up' class on an li tag -->
13
+ <!-- will make the li more pronounced. -->
14
+ <li class="heads-up">
15
+ Sub-header
16
+ </li>
17
+ <li>
18
+ <a href="#">
19
+ Important
20
+ </a>
21
+ </li>
22
+ <li>
23
+ <a href="#">
24
+ Not as important
25
+ </a>
26
+ </li>
27
+ <li class="heads-up">
28
+ Info about these
29
+ </li>
30
+ <li>
31
+ <a href="#">
32
+ These one
33
+ </a>
34
+ </li>
35
+ <li>
36
+ <a href="#">
37
+ These two
38
+
39
+ </a>
40
+ </li>
41
+ </ul>
42
+ </div>
43
+
44
+ <!-- A button dropdown with a normal button -->
45
+ <div class="button-drop">
46
+ <!-- You MUST give the button in the button drop an id-->
47
+ <button id="two" class="bsimple">
48
+ Dropdown
49
+ </button>
50
+ <ul class="drop">
51
+ <li class="heads-up">
52
+ Drop-menu
53
+ </li>
54
+ <li>
55
+ <a href="#">
56
+ thing2
57
+ </a>
58
+ </li>
59
+ <li>
60
+ <a href="#">
61
+ thing
62
+ </a>
63
+ </li>
64
+ <li>
65
+ <a href="#">
66
+ thing2
67
+
68
+ </a>
69
+ </li>
70
+ </ul>
71
+ </div>
72
+
73
+ <!-- Small button-drop example -->
74
+ <div class="button-drop">
75
+ <!-- You MUST give the button in the button drop an id-->
76
+ <button id="three" class="bsimple small blue">
77
+ Small drop
78
+ </button>
79
+ <ul class="drop">
80
+ <li>
81
+ <a href="#">
82
+ Small thing
83
+ </a>
84
+ </li>
85
+ <li>
86
+ <a href="#">
87
+ Another small thing
88
+
89
+ </a>
90
+ </li>
91
+ </ul>
92
+ </div>
93
+ <div class="clear">
94
+ .button-drop
95
+
96
+ <!-- Button sets! -->
97
+
98
+ <!-- Each button set is stored inside a div with -->
99
+ <!-- class button-set -->
100
+ </div>
101
+ <div class="button-set">
102
+ <!-- Give a button class left to make it the left-side -->
103
+ <button class="bsimple small left">
104
+ Left
105
+ </button>
106
+ <!-- Class mid will make the button a middle button -->
107
+ <button class="bsimple small mid">
108
+ Mid
109
+ </button>
110
+ <!-- You can see where this is going -->
111
+ <button class="bsimple small mid">
112
+ Mid 2
113
+ </button>
114
+ <!-- Finally class right will end the button set -->
115
+ <button class="bsimple small right">
116
+ Right
117
+ </button>
118
+ </div>
119
+ <div class="clear">
120
+ .button-set.small
121
+
122
+ <!-- An example with a normal sized button-set -->
123
+ </div>
124
+ <div class="button-set">
125
+ <button class="bsimple teal left">
126
+ Left
127
+ </button>
128
+ <button class="bsimple yellow mid">
129
+ Mid
130
+ </button>
131
+ <button class="bsimple red right">
132
+ Right
133
+ </button>
134
+ </div>
135
+ <div class="clear">
136
+ .button-set
137
+
138
+ <!-- Here is an example with the large button set -->
139
+ </div>
140
+ <div class="button-set">
141
+ <button class="bsimple large green left">
142
+ Left
143
+ </button>
144
+ <button class="bsimple large green mid">
145
+ Mid
146
+ </button>
147
+ <button class="bsimple large green right">
148
+ Right
149
+ </button>
150
+ </div>
151
+ <div class="clear">
152
+ .button-set.large
153
+
154
+ <!-- Creating a button with bbuttons is as simple as -->
155
+ <!-- giving the button the class 'bsimple'. -->
156
+
157
+ <!-- If you feel really froggy, you can even use the bsimple -->
158
+ <!-- mixin inside your css file. -->
159
+ <!-- If you don't like my pre-defined colors, (No one blames you) -->
160
+ <!-- then pass the bsimple mixin any color you like! -->
161
+ <!-- Refer to the scss file for the mixin. -->
162
+
163
+ <!-- Make your button small by adding the class 'small' -->
164
+ </div>
165
+ <button class="bsimple small">
166
+ Content
167
+ </button>
168
+ <button class="bsimple blue small">
169
+ Content
170
+ </button>
171
+ <button class="bsimple teal small">
172
+ Content
173
+ </button>
174
+ <button class="bsimple green small">
175
+ Content
176
+ </button>
177
+ <button class="bsimple yellow small">
178
+ Content
179
+ </button>
180
+ <button class="bsimple red small">
181
+ Content
182
+ </button>
183
+ <div class="clear">
184
+ button.bsimple.small
185
+
186
+ </div>
187
+ <button class="bsimple">
188
+ Content
189
+ </button>
190
+ <button class="bsimple blue">
191
+ Content
192
+ </button>
193
+ <button class="bsimple teal">
194
+ Content
195
+ </button>
196
+ <button class="bsimple green">
197
+ Content
198
+ </button>
199
+ <button class="bsimple yellow">
200
+ Content
201
+ </button>
202
+ <button class="bsimple red">
203
+ Content
204
+ </button>
205
+ <div class="clear">
206
+ button.bsimple
207
+
208
+ <!-- Or, you can make large buttons by adding the class 'large' -->
209
+ </div>
210
+ <button class="bsimple large">
211
+ Content
212
+ </button>
213
+ <button class="bsimple blue large">
214
+ Content
215
+ </button>
216
+ <button class="bsimple teal large">
217
+ Content
218
+ </button>
219
+ <button class="bsimple green large">
220
+ Content
221
+ </button>
222
+ <button class="bsimple yellow large">
223
+ Content
224
+ </button>
225
+ <button class="bsimple red large">
226
+ Content
227
+ </button>
228
+ <div class="clear">
229
+ button.bsimple.large
230
+ </div>
@@ -0,0 +1,6 @@
1
+ $(document).ready(function() {
2
+ $('.button-drop').click(function(event) {
3
+ var id = event.target.id;
4
+ return this.$("button[id=" + id + "] ~ ul").toggle();
5
+ });
6
+ });
@@ -0,0 +1,16 @@
1
+ stylesheet '_bbuttons.scss', :media => 'screen, projection'
2
+ html 'bbuttons.html'
3
+ javascript 'bbuttons.js'
4
+
5
+ description "Simple, palpable button mixin."
6
+
7
+ help %Q{
8
+ Installs some html, a stylesheet partial and javascript. Requires
9
+ jquery for the button dropdown.
10
+ }
11
+
12
+ welcome_message %Q{
13
+ Please refer to the bbuttons.html file to see how the markup should be
14
+ structured. If you want to peek into the _bbuttons.scss file, you can get a
15
+ look at the mixins available to you.
16
+ }
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bbuttons
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Taylor Stackpole
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-06-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: compass
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0.11'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0.11'
30
+ description: Easy to use buttons/button-groups/button-dropdowns
31
+ email: tay.stack@gmail.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - README.mkdn
37
+ - lib/bbuttons.rb
38
+ - stylesheets/_bbuttons.scss
39
+ - templates/project/_bbuttons.scss
40
+ - templates/project/manifest.rb
41
+ - templates/project/bbuttons.html
42
+ - templates/project/bbuttons.js
43
+ homepage: http://www.github.com/taystack
44
+ licenses: []
45
+ post_install_message:
46
+ rdoc_options: []
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubyforge_project:
63
+ rubygems_version: 1.8.23
64
+ signing_key:
65
+ specification_version: 3
66
+ summary: Simple buttons for the simple developer.
67
+ test_files: []