fancy-buttons 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fancy-buttons}
8
- s.version = "0.5.4"
8
+ s.version = "0.5.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Brandon Mathis"]
12
- s.date = %q{2010-05-23}
12
+ s.date = %q{2010-07-29}
13
13
  s.description = %q{Easily style buttons with beautiful CSS3 features like gradients, rounded corners, etc. Don't worry the buttons also degrade nicely for browsers with no support. This requires the Compass stylesheet authoring framework.}
14
14
  s.email = %q{brandon@imathis.com}
15
15
  s.extra_rdoc_files = [
@@ -24,22 +24,20 @@ Gem::Specification.new do |s|
24
24
  "lib/stylesheets/_fancy-gradient.sass",
25
25
  "lib/stylesheets/_fancy_buttons.sass",
26
26
  "lib/templates/project/button_bg.png",
27
- "lib/templates/project/buttons.sass",
28
27
  "lib/templates/project/ie6.sass",
29
- "lib/templates/project/index.html",
30
28
  "lib/templates/project/manifest.rb"
31
29
  ]
32
30
  s.homepage = %q{http://github.com/imathis/fancy-buttons}
33
31
  s.rdoc_options = ["--charset=UTF-8"]
34
32
  s.require_paths = ["lib"]
35
- s.rubygems_version = %q{1.3.6}
33
+ s.rubygems_version = %q{1.3.7}
36
34
  s.summary = %q{Make fancy buttons with the Compass stylesheet authoring framework.}
37
35
 
38
36
  if s.respond_to? :specification_version then
39
37
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
40
38
  s.specification_version = 3
41
39
 
42
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
40
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
43
41
  s.add_runtime_dependency(%q<haml>, [">= 3.0.2"])
44
42
  s.add_runtime_dependency(%q<compass>, [">= 0.10.0"])
45
43
  else
@@ -12,6 +12,7 @@ $fb_light_text: white !default
12
12
  $fb_dark_text: #222222 !default
13
13
  $fb_gradient: 1 !default
14
14
  $fb_image_path: image_url("button_bg.png") !default
15
+ $fb_allow_disabled: true !default
15
16
 
16
17
  // Make a fancy button.
17
18
  =fancy-button($color: $fb_color, $font_size: $fb_font_size, $radius: $fb_radius, $border_width: $fb_border_width)
@@ -19,10 +20,11 @@ $fb_image_path: image_url("button_bg.png") !default
19
20
  +fancy-button-colors($color)
20
21
 
21
22
  // Style the button's colors, picking the most appropriate color set for the base color.
22
- =fancy-button-colors($color: $fb_color, $hover: 0, $active: 0)
23
+ =fancy-button-colors($color: $fb_color, $hover: 0, $active: 0, $allow_disabled: $fb_allow_disabled)
23
24
  +fb-color($color, "default")
24
- &.disabled:active, &.disabled:hover, &[disabled]:active, &[disabled]:hover
25
- +fb-color($color, "default")
25
+ @if $allow_disabled
26
+ &.disabled:active, &.disabled:hover, &[disabled]:active, &[disabled]:hover
27
+ +fb-color($color, "default")
26
28
  &:hover, &:focus
27
29
  @if $hover == 0
28
30
  +fb-color(darken($color, 3), "hover", $color)
@@ -100,14 +102,20 @@ $fb_image_path: image_url("button_bg.png") !default
100
102
  &, &:visited
101
103
  color: $fb_dark_text
102
104
 
103
- =fancy-button-text-colors($color, $hover, $active)
105
+ =fancy-button-text-colors($color, $hover, $active, $allow-disabled : $fb-allow-disabled)
104
106
  color: $color
105
- &:hover, &:focus
106
- color: $hover
107
- &:active
108
- color: $active
109
- &.disabled:active, &.disabled:hover, &[disabled]:active, &[disabled]:hover
110
- color: $color
107
+ @if $hover != $color
108
+ &:hover, &:focus
109
+ color: $hover
110
+ @if $active != $color
111
+ &:active
112
+ color: $active
113
+ @if $allow-disabled and $active != $color
114
+ &.disabled:active, &[disabled]:active
115
+ color: $color
116
+ @if $allow-disabled and $hover != $color
117
+ &.disabled:hover, &[disabled]:hover
118
+ color: $color
111
119
 
112
120
  // Apply this mixin to a nested element to style an arrow
113
121
  =fancy-arrow($font_size)
@@ -116,11 +124,11 @@ $fb_image_path: image_url("button_bg.png") !default
116
124
  margin-left: 4px
117
125
 
118
126
  // Layout the button's box
119
- =fancy-button-structure($font_size: $fb_font_size, $radius: $fb_radius, $border_width: $fb_border_width, $line_height: $font_size * 1.2)
120
- +fb-reset
121
- +fancy-button-size($font_size, $radius, $border_width, $line_height)
127
+ =fancy-button-structure($font_size: $fb_font_size, $radius: $fb_radius, $border_width: $fb_border_width, $line_height: $font_size * 1.2, $allow_disabled: $fb_allow_disabled)
128
+ +fb-reset($fb_font_weight, $allow_disabled)
129
+ +fancy-button-size($font_size, $radius, $border_width, $line_height, $allow_disabled)
122
130
 
123
- =fancy-button-size($font_size: $fb_font_size, $radius: $fb_radius, $border_width: $fb_border_width, $line_height: $font_size * 1.2)
131
+ =fancy-button-size($font_size: $fb_font_size, $radius: $fb_radius, $border_width: $fb_border_width, $line_height: $font_size * 1.2, $allow_disabled: $fb_allow_disabled)
124
132
  // better padding for smaller buttons
125
133
  $v_padding: 0
126
134
  $h_padding: 0
@@ -134,9 +142,9 @@ $fb_image_path: image_url("button_bg.png") !default
134
142
  +border-radius($radius)
135
143
  font-size: $font_size
136
144
  line-height: $line_height
137
- +fancy-button-padding($v_padding, $h_padding, $border_width)
145
+ +fancy-button-padding($v_padding, $h_padding, $border_width, $allow_disabled)
138
146
 
139
- =fancy-button-padding($v_padding, $h_padding, $border_width: $fb_border_width)
147
+ =fancy-button-padding($v_padding, $h_padding, $border_width: $fb_border_width, $allow_disabled: $fb_allow_disabled)
140
148
  $v_padding_active: $v_padding - 1px
141
149
  $h_padding_active: $h_padding - 1px
142
150
  padding: $v_padding $h_padding
@@ -144,12 +152,13 @@ $fb_image_path: image_url("button_bg.png") !default
144
152
  &:active
145
153
  padding: $v_padding_active $h_padding_active
146
154
  border-width: $border_width + 1px
147
- &.disabled:active, &[disabled]
148
- padding: $v_padding $h_padding
149
- border-width: $border_width
155
+ @if $allow_disabled
156
+ &.disabled:active, &[disabled]
157
+ padding: $v_padding $h_padding
158
+ border-width: $border_width
150
159
 
151
160
  // Reset the button's important properties to make sure they behave correctly
152
- =fb-reset($font_weight: $fb_font_weight)
161
+ =fb-reset($font_weight: $fb_font_weight, $allow_disabled: $fb_allow_disabled)
153
162
  font-family: "Lucida Grande", Lucida, Arial, sans_serif
154
163
  background: #{$fb_image_path} repeat-x bottom left
155
164
  margin: 0
@@ -165,8 +174,9 @@ $fb_image_path: image_url("button_bg.png") !default
165
174
  padding: 0
166
175
  &:focus
167
176
  outline: none
168
- &.disabled, &[disabled]
169
- +disable-button
177
+ @if $fb_allow_disabled
178
+ &.disabled, &[disabled]
179
+ +disable-button
170
180
 
171
181
  =disable-button($opacity: 0.7)
172
182
  +opacity($opacity)
@@ -2,10 +2,12 @@
2
2
  stylesheet 'ie6.sass', :media => 'screen, projection', :condition => "lt IE 7"
3
3
  image 'button_bg.png'
4
4
 
5
+ #print "Check out http://brandonmathis.com/projects/fancy-buttons/guide/ to get a guide on how to use fancy-buttons"
6
+
5
7
  #print "Install example files? (html and buttons.sass) (Y/n)?"
6
8
  #response = gets
7
9
  #if response.downcase == "y" || response.downcase == "\n"
8
- file 'index.html'
9
- stylesheet 'buttons.sass', :media => 'screen, projection'
10
+ #file 'index.html'
11
+ #stylesheet 'buttons.sass', :media => 'screen, projection'
10
12
  #end
11
13
  #print 'Don\'t forget to @import "fancy-buttons"'
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fancy-buttons
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 1
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 5
8
- - 4
9
- version: 0.5.4
9
+ - 5
10
+ version: 0.5.5
10
11
  platform: ruby
11
12
  authors:
12
13
  - Brandon Mathis
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-05-23 00:00:00 -05:00
18
+ date: 2010-07-29 00:00:00 -05:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: haml
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 3
27
30
  segments:
28
31
  - 3
29
32
  - 0
@@ -35,9 +38,11 @@ dependencies:
35
38
  name: compass
36
39
  prerelease: false
37
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
38
42
  requirements:
39
43
  - - ">="
40
44
  - !ruby/object:Gem::Version
45
+ hash: 55
41
46
  segments:
42
47
  - 0
43
48
  - 10
@@ -62,9 +67,7 @@ files:
62
67
  - lib/stylesheets/_fancy-gradient.sass
63
68
  - lib/stylesheets/_fancy_buttons.sass
64
69
  - lib/templates/project/button_bg.png
65
- - lib/templates/project/buttons.sass
66
70
  - lib/templates/project/ie6.sass
67
- - lib/templates/project/index.html
68
71
  - lib/templates/project/manifest.rb
69
72
  has_rdoc: true
70
73
  homepage: http://github.com/imathis/fancy-buttons
@@ -76,23 +79,27 @@ rdoc_options:
76
79
  require_paths:
77
80
  - lib
78
81
  required_ruby_version: !ruby/object:Gem::Requirement
82
+ none: false
79
83
  requirements:
80
84
  - - ">="
81
85
  - !ruby/object:Gem::Version
86
+ hash: 3
82
87
  segments:
83
88
  - 0
84
89
  version: "0"
85
90
  required_rubygems_version: !ruby/object:Gem::Requirement
91
+ none: false
86
92
  requirements:
87
93
  - - ">="
88
94
  - !ruby/object:Gem::Version
95
+ hash: 3
89
96
  segments:
90
97
  - 0
91
98
  version: "0"
92
99
  requirements: []
93
100
 
94
101
  rubyforge_project:
95
- rubygems_version: 1.3.6
102
+ rubygems_version: 1.3.7
96
103
  signing_key:
97
104
  specification_version: 3
98
105
  summary: Make fancy buttons with the Compass stylesheet authoring framework.
@@ -1,57 +0,0 @@
1
- @import fancy-buttons
2
-
3
- body
4
- text-align: center
5
- padding-top: 10px
6
- h1, h2, h3
7
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif
8
- color: #333
9
- letter-spacing: -1px
10
- h1
11
- font-size: 50px
12
- h2
13
- font-size: 30px
14
- div
15
- margin-top: 15px
16
-
17
- $green: darken(#57b42c, 8)
18
- $blue: adjust_hue($green, 110)
19
- $red: adjust_hue($green, -100)
20
- $heart_button: saturate(lighten($red, 2), 20)
21
-
22
-
23
- =custom-fancy-gradient($color1, $color2)
24
- +radial-gradient(color_stops($color1, darken($color2, 5) 30px), "50% 10%")
25
- =invert-custom-fancy-gradient($color1, $color2)
26
- +custom-fancy-gradient(lighten($color2, 10), lighten($color2, 25))
27
-
28
- a.button, button
29
- +fancy-button-structure
30
- +fancy-button-colors
31
- margin: 0 2px
32
- vertical-align: middle
33
- &.light
34
- +fancy-button-colors-matte(#ddd)
35
- &.matte-blue
36
- +fancy-button-colors-matte($blue)
37
- &.green
38
- +fancy-button-colors($green)
39
- &.blue
40
- +fancy-button-size(32px, 32px, 3px)
41
- +fancy-button-colors($blue)
42
- &.red
43
- +fancy-button-colors($red)
44
- &.yellow
45
- +fancy-button-colors(darken(desaturate(yellow, 35), 5))
46
- &.custom
47
- +fancy-button-size(30px, 10px)
48
- +fancy-button-padding(2px, 12px, 2px)
49
- &.heart
50
- +fancy-button-colors-custom($heart_button)
51
- &.arrow
52
- +fancy-button-size(30px, 30px)
53
- +fancy-button-colors-custom(#ddd)
54
- +fancy-button-padding(2px, 6px, 2px)
55
- &.spade
56
- +fancy-button-colors-custom($blue)
57
- +fancy-button-padding(2px, 8px, 2px)
@@ -1,39 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
- <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
5
- <title>Fancy Buttons - Demo</title>
6
- <link href="./stylesheets/buttons.css" media="screen, projection" rel="stylesheet" type="text/css" />
7
- <!--[if lte IE 6]>
8
- <link href='./stylesheets/ie6.css' rel='stylesheet' type='text/css' />
9
- <![endif]-->
10
- </head>
11
- <body>
12
- <h1>Fancy Buttons</h1>
13
- <div>
14
- <button class="green">Click Me</button>
15
- <a href="#" class="button blue">Click Me</a>
16
- <button class="red">Click Me</button>
17
- </div>
18
- <div>
19
- <button>Click Me</button>
20
- <button class="yellow">Click Me</button>
21
- </div>
22
- <h2>Matte Gradient</h2>
23
- <div>
24
- <button class="light">Click Me</button>
25
- <button class="matte-blue">Click Me</button>
26
- </div>
27
- <h2>Disabled Buttons</h2>
28
- <div>
29
- <button class="green" disabled>Click Me</button>
30
- <button class="red" disabled>Click Me</button>
31
- </div>
32
- <h2>Custom Radial Gradient</h2>
33
- <div>
34
- <button class="custom heart">&hearts;</button>
35
- <button class="custom arrow">&rarr;</button>
36
- <button class="custom spade">&Omega;</button>
37
- </div>
38
- </body>
39
- </html>