ghbuttons-rails 0.0.2
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/LICENSE +0 -0
- data/README.md +30 -0
- data/app/assets/images/ghbuttons-sprite.png +0 -0
- data/app/assets/stylesheets/_ghbuttons_mixins.scss +42 -0
- data/app/assets/stylesheets/_ghbuttons_variables.scss +30 -0
- data/app/assets/stylesheets/ghbuttons.scss +171 -0
- data/ghbuttons-rails.gemspec +22 -0
- data/lib/ghbuttons-rails.rb +8 -0
- data/lib/ghbuttons-rails/version.rb +5 -0
- metadata +88 -0
data/LICENSE
ADDED
File without changes
|
data/README.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# ghbuttons-rails
|
2
|
+
|
3
|
+
Github-style buttons for the Rails Asset Pipeline.
|
4
|
+
|
5
|
+
Inspired by and ripped out of css3-gitgub-buttons
|
6
|
+
|
7
|
+
http://nicolasgallagher.com/lab/css3-github-buttons/
|
8
|
+
|
9
|
+
# Usage:
|
10
|
+
|
11
|
+
- include the stylesheet directly, or include it in your application.css with directives
|
12
|
+
- use the generated css wisely.
|
13
|
+
- use the mixins to make your own semantic css.
|
14
|
+
|
15
|
+
# TODO:
|
16
|
+
|
17
|
+
- Finish sassification. I'd like the colors to be variables you can override.
|
18
|
+
- I'd like danger and positive to be created by a mixin you can use with your own
|
19
|
+
colors, so you can have your own semantic classes for emphasis.
|
20
|
+
- I want to make some more things mixins - 'big' is presentational, not declarative.
|
21
|
+
- Making the 'button' a semantic mixin is going to be tough - the containers modify it,
|
22
|
+
and it is huge, so it will be inefficient to spit out everything multiple times.
|
23
|
+
- Since I wrote this I found the font-awesome project and released the font-awesome
|
24
|
+
rails bundle at https://github.com/bokmann/font-awesome-rails.
|
25
|
+
I'm considering removing all of the complexity in this ghbuttons project around the
|
26
|
+
sprites, and just making those two gems work seamlessly together.
|
27
|
+
|
28
|
+
# License:
|
29
|
+
|
30
|
+
MIT license.
|
Binary file
|
@@ -0,0 +1,42 @@
|
|
1
|
+
@mixin ghbutton-highlight($text-color, $alt-text-color, $background1, $background2) {
|
2
|
+
$highlight-1: mix($background1, $background2);
|
3
|
+
$highlight-2: mix($background1, $background2, 75%);
|
4
|
+
$highlight-3: mix($background1, $background2, 85%);
|
5
|
+
|
6
|
+
color: $text-color;
|
7
|
+
&:hover, &:focus {
|
8
|
+
border-color: $highlight-3;
|
9
|
+
border-bottom-color: $background1;
|
10
|
+
color: $alt-text-color;
|
11
|
+
background-color: $background2;
|
12
|
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from($background2), to($highlight-2));
|
13
|
+
background-image: -moz-linear-gradient($background2, $highlight-2);
|
14
|
+
background-image: -o-linear-gradient($background2, $highlight-2);
|
15
|
+
background-image: linear-gradient($background2, $highlight-2);
|
16
|
+
text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.3);
|
17
|
+
}
|
18
|
+
&:active, &.active {
|
19
|
+
color: $alt-text-color;
|
20
|
+
border-color: $background1;
|
21
|
+
border-bottom-color: $highlight-1;
|
22
|
+
background-color: $highlight-2;
|
23
|
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from($highlight-2), to($background2));
|
24
|
+
background-image: -moz-linear-gradient($highlight-2, $background2);
|
25
|
+
background-image: -o-linear-gradient($highlight-2, $background2);
|
26
|
+
background-image: linear-gradient($highlight-2, $background2);
|
27
|
+
text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.3);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
@mixin ghbutton-pill($radius) {
|
32
|
+
-webkit-border-radius: $radius;
|
33
|
+
-moz-border-radius: $radius;
|
34
|
+
border-radius: $radius;
|
35
|
+
}
|
36
|
+
|
37
|
+
@mixin ghbutton-big($font-size) {
|
38
|
+
font-size: $font-size;
|
39
|
+
&.icon:before {
|
40
|
+
top: 0;
|
41
|
+
}
|
42
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
$ghbutton-pill-radius: 1em !default;
|
2
|
+
$ghbutton-default-big-size: 14px !default;
|
3
|
+
$ghbutton-text-color: #333 !default;
|
4
|
+
$ghbutton-text-alt-color: #fff !default;
|
5
|
+
$ghbutton-background-color1: #f4f4f4 !default;
|
6
|
+
$ghbutton-background-color2: #ececec !default;
|
7
|
+
$ghbutton-highlight-color1: #3072b3 !default;
|
8
|
+
$ghbutton-highlight-color2: #599bdc !default;
|
9
|
+
$ghbutton-border-color: #d4d4d4 !default;
|
10
|
+
|
11
|
+
$ghbuttons-sprites: aperture, arrow_down, arrow_left, arrow_right, arrow_up, article, bars,
|
12
|
+
bars_alt, bolt, book, book_alt, book_alt2, box, brush, brush_alt, calendar,
|
13
|
+
calendar_alt_fill, calendar_alt_stroke, camera, cd, chart, chart_alt, chat,
|
14
|
+
chat_alt_fill, chat_alt_stroke, check, check_alt, clock, cog, comment_alt1_fill,
|
15
|
+
comment_alt1_stroke, comment_alt2_fill, comment_alt2_stroke, comment_fill,
|
16
|
+
comment_stroke, compass, cursor, curved_arrow, denied, dial, document_alt_fill,
|
17
|
+
document_alt_stroke, document_fill, document_stroke, download, eject, equalizer,
|
18
|
+
eye, first, folder_fill, folder_stroke, fork, fullscreen, fullscreen_alt,
|
19
|
+
fullscreen_exit, fullscreen_exit_alt, hash, headphones, heart_fill, heart_stroke,
|
20
|
+
home, image, info, key_stroke, last, layers, layers_alt, left_quote, link, list,
|
21
|
+
list_nested, lock_stroke, loop, magnifying_glass, mail, map_pin_fill,
|
22
|
+
map_pin_stroke, mic, minus, moon_fill, moon_stroke, move, move_alt1,
|
23
|
+
move_horizontal, move_horizontal_alt1, move_vertical, move_vertical_alt1,
|
24
|
+
new_window, pause, pen, pen_alt2, pilcrow, pin, play, plus, rain, read_more,
|
25
|
+
reload, right_quote, rss, rss_alt, share, spin, star, steering_wheel, stop,
|
26
|
+
sun_fill, sun_stroke, tag_fill, tag_stroke, target, transfer, trash_fill,
|
27
|
+
trash_stroke, umbrella, undo, unlock_stroke, upload, user, volume, volume_mute,
|
28
|
+
wrench, x;
|
29
|
+
|
30
|
+
|
@@ -0,0 +1,171 @@
|
|
1
|
+
/* ------------------------------------------
|
2
|
+
ghbuttons-rails
|
3
|
+
(Original CSS by Nicolas Gallagher, Sassified by David Bock)
|
4
|
+
*/
|
5
|
+
|
6
|
+
@import "ghbuttons_variables";
|
7
|
+
@import "ghbuttons_mixins";
|
8
|
+
|
9
|
+
.button {
|
10
|
+
position: relative;
|
11
|
+
overflow: visible;
|
12
|
+
display: inline-block;
|
13
|
+
padding: 0.5em 1em;
|
14
|
+
border: 1px solid $ghbutton-border-color;
|
15
|
+
margin: 0;
|
16
|
+
text-decoration: none;
|
17
|
+
text-shadow: 1px 1px 0 #fff;
|
18
|
+
font: 11px / normal sans-serif;
|
19
|
+
white-space: nowrap;
|
20
|
+
cursor: pointer;
|
21
|
+
outline: none;
|
22
|
+
|
23
|
+
background-color: $ghbutton-background-color2;
|
24
|
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from($ghbutton-background-color1), to($ghbutton-background-color2));
|
25
|
+
background-image: -moz-linear-gradient($ghbutton-background-color1, $ghbutton-background-color2);
|
26
|
+
background-image: -o-linear-gradient($ghbutton-background-color1, $ghbutton-background-color2);
|
27
|
+
background-image: linear-gradient($ghbutton-background-color1, $ghbutton-background-color2);
|
28
|
+
|
29
|
+
-webkit-background-clip: padding;
|
30
|
+
-moz-background-clip: padding;
|
31
|
+
-o-background-clip: padding-box;
|
32
|
+
/*background-clip: padding-box;*/
|
33
|
+
/* commented out due to Opera 11.10 bug */
|
34
|
+
-webkit-border-radius: 0.2em;
|
35
|
+
-moz-border-radius: 0.2em;
|
36
|
+
border-radius: 0.2em;
|
37
|
+
/* IE hacks */
|
38
|
+
zoom: 1;
|
39
|
+
*display: inline;
|
40
|
+
|
41
|
+
@include ghbutton-highlight($ghbutton-text-color, $ghbutton-text-alt-color, $ghbutton-highlight-color1, $ghbutton-highlight-color2);
|
42
|
+
|
43
|
+
&::-moz-focus-inner {
|
44
|
+
padding: 0;
|
45
|
+
border: 0; }
|
46
|
+
|
47
|
+
&.icon:before {
|
48
|
+
content: "";
|
49
|
+
position: relative;
|
50
|
+
top: -1px;
|
51
|
+
float: left;
|
52
|
+
width: 12px;
|
53
|
+
height: 12px;
|
54
|
+
margin: 0 0.75em 0 -0.25em;
|
55
|
+
background: url(ghbuttons-sprite.png) 0 99px no-repeat;
|
56
|
+
}
|
57
|
+
|
58
|
+
$i: 0;
|
59
|
+
@each $sprite in $ghbuttons-sprites {
|
60
|
+
&.#{$sprite}.icon {
|
61
|
+
&:before {
|
62
|
+
background-position: 0 $i*-12px;
|
63
|
+
}
|
64
|
+
&:hover:before, &:focus:before, &:active:before {
|
65
|
+
background-position: -12px $i*-12px;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
$i: $i + 1;
|
69
|
+
}
|
70
|
+
|
71
|
+
// special case button. right arrow on the right side.
|
72
|
+
&.arrow_right.icon:before {
|
73
|
+
float: right;
|
74
|
+
margin: 0 -0.25em 0 0.5em;
|
75
|
+
}
|
76
|
+
|
77
|
+
&.primary {
|
78
|
+
font-weight: bold;
|
79
|
+
}
|
80
|
+
|
81
|
+
&.danger {
|
82
|
+
@include ghbutton-highlight(#900, #fff, #a0302a, #dc5f59);
|
83
|
+
}
|
84
|
+
|
85
|
+
&.positive {
|
86
|
+
@include ghbutton-highlight(#090, #fff, #45bf55, #96ed89);
|
87
|
+
}
|
88
|
+
|
89
|
+
&.pill {
|
90
|
+
@include ghbutton-pill($ghbutton-pill-radius);
|
91
|
+
}
|
92
|
+
|
93
|
+
&.disable {
|
94
|
+
opacity: 0.5;
|
95
|
+
}
|
96
|
+
|
97
|
+
&.big {
|
98
|
+
@include ghbutton-big($ghbutton-default-big-size);
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
.button-group {
|
103
|
+
display: inline-block;
|
104
|
+
list-style: none;
|
105
|
+
padding: 0;
|
106
|
+
margin: 0;
|
107
|
+
/* IE hacks */
|
108
|
+
zoom: 1;
|
109
|
+
*display: inline; }
|
110
|
+
|
111
|
+
.button + {
|
112
|
+
.button, .button-group {
|
113
|
+
margin-left: 15px;
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
.button-group {
|
118
|
+
+ {
|
119
|
+
.button, .button-group {
|
120
|
+
margin-left: 15px;
|
121
|
+
}
|
122
|
+
}
|
123
|
+
li {
|
124
|
+
float: left;
|
125
|
+
padding: 0;
|
126
|
+
margin: 0;
|
127
|
+
}
|
128
|
+
.button {
|
129
|
+
float: left;
|
130
|
+
margin-left: -1px;
|
131
|
+
}
|
132
|
+
> .button:not(:first-child):not(:last-child), li:not(:first-child):not(:last-child) .button {
|
133
|
+
-webkit-border-radius: 0;
|
134
|
+
-moz-border-radius: 0;
|
135
|
+
border-radius: 0; }
|
136
|
+
> .button:first-child, li:first-child .button {
|
137
|
+
margin-left: 0;
|
138
|
+
-webkit-border-top-right-radius: 0;
|
139
|
+
-webkit-border-bottom-right-radius: 0;
|
140
|
+
-moz-border-radius-topright: 0;
|
141
|
+
-moz-border-radius-bottomright: 0;
|
142
|
+
border-top-right-radius: 0;
|
143
|
+
border-bottom-right-radius: 0; }
|
144
|
+
> .button:last-child, li:last-child > .button {
|
145
|
+
-webkit-border-top-left-radius: 0;
|
146
|
+
-webkit-border-bottom-left-radius: 0;
|
147
|
+
-moz-border-radius-topleft: 0;
|
148
|
+
-moz-border-radius-bottomleft: 0;
|
149
|
+
border-top-left-radius: 0;
|
150
|
+
border-bottom-left-radius: 0; }
|
151
|
+
&.minor-group .button {
|
152
|
+
border: 1px solid $ghbutton-border-color;
|
153
|
+
text-shadow: none;
|
154
|
+
background-image: none;
|
155
|
+
background-color: #fff;
|
156
|
+
&:hover, &:focus {
|
157
|
+
background-color: $ghbutton-highlight-color2; }
|
158
|
+
&:active, &.active {
|
159
|
+
background-color: $ghbutton-highlight-color1; }
|
160
|
+
&.icon:before {
|
161
|
+
opacity: 0.8;
|
162
|
+
}
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
|
167
|
+
.button-container {
|
168
|
+
.button, .button-group {
|
169
|
+
vertical-align: top;
|
170
|
+
}
|
171
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "ghbuttons-rails/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "ghbuttons-rails"
|
7
|
+
s.version = Ghbuttons::Rails::VERSION
|
8
|
+
s.authors = ["bokmann"]
|
9
|
+
s.email = ["dbock@codesherpas.com"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = %q{a sassified and gem packaged version if css3 github buttons}
|
12
|
+
s.description = %q{a sassified and gem packaged version if css3 github buttons}
|
13
|
+
|
14
|
+
s.rubyforge_project = "ghbuttons-rails"
|
15
|
+
|
16
|
+
s.files = Dir["{lib,app}/**/*"] + ["ghbuttons-rails.gemspec", "LICENSE", "README.md"]
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.add_dependency "railties", "~> 3.1"
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ghbuttons-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- bokmann
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2012-03-14 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
type: :runtime
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 5
|
28
|
+
segments:
|
29
|
+
- 3
|
30
|
+
- 1
|
31
|
+
version: "3.1"
|
32
|
+
name: railties
|
33
|
+
version_requirements: *id001
|
34
|
+
prerelease: false
|
35
|
+
description: a sassified and gem packaged version if css3 github buttons
|
36
|
+
email:
|
37
|
+
- dbock@codesherpas.com
|
38
|
+
executables: []
|
39
|
+
|
40
|
+
extensions: []
|
41
|
+
|
42
|
+
extra_rdoc_files: []
|
43
|
+
|
44
|
+
files:
|
45
|
+
- lib/ghbuttons-rails/version.rb
|
46
|
+
- lib/ghbuttons-rails.rb
|
47
|
+
- app/assets/images/ghbuttons-sprite.png
|
48
|
+
- app/assets/stylesheets/_ghbuttons_mixins.scss
|
49
|
+
- app/assets/stylesheets/_ghbuttons_variables.scss
|
50
|
+
- app/assets/stylesheets/ghbuttons.scss
|
51
|
+
- ghbuttons-rails.gemspec
|
52
|
+
- LICENSE
|
53
|
+
- README.md
|
54
|
+
homepage: ""
|
55
|
+
licenses: []
|
56
|
+
|
57
|
+
post_install_message:
|
58
|
+
rdoc_options: []
|
59
|
+
|
60
|
+
require_paths:
|
61
|
+
- lib
|
62
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
hash: 3
|
68
|
+
segments:
|
69
|
+
- 0
|
70
|
+
version: "0"
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
hash: 3
|
77
|
+
segments:
|
78
|
+
- 0
|
79
|
+
version: "0"
|
80
|
+
requirements: []
|
81
|
+
|
82
|
+
rubyforge_project: ghbuttons-rails
|
83
|
+
rubygems_version: 1.8.10
|
84
|
+
signing_key:
|
85
|
+
specification_version: 3
|
86
|
+
summary: a sassified and gem packaged version if css3 github buttons
|
87
|
+
test_files: []
|
88
|
+
|