fancy-buttons 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -7,9 +7,8 @@ begin
7
7
  gemspec.email = "brandon@imathis.com"
8
8
  gemspec.homepage = "http://github.com/imathis/fancy-buttons"
9
9
  gemspec.author = "Brandon Mathis"
10
- gemspec.add_dependency('haml', '>= 2.2.14')
11
- gemspec.add_dependency('compass', '>= 0.10.0.pre8')
12
- gemspec.add_dependency('compass-colors', '>= 0.3.1')
10
+ gemspec.add_dependency('haml', '>= 3.0.0.beta.3')
11
+ gemspec.add_dependency('compass', '>= 0.10.0.rc3')
13
12
  gemspec.files = []
14
13
  gemspec.files << "fancy-buttons.gemspec"
15
14
  gemspec.files << "README.markdown"
@@ -18,5 +17,5 @@ begin
18
17
  gemspec.files += Dir.glob("lib/**/*")
19
18
  end
20
19
  rescue LoadError
21
- puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
20
+ puts "Jeweler not available. Install it with: sudo gem install jeweler -s http://rubygems.org"
22
21
  end
@@ -1,15 +1,15 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{fancy-buttons}
8
- s.version = "0.4.1"
8
+ s.version = "0.5.0"
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-02-25}
12
+ s.date = %q{2010-04-24}
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 = [
@@ -20,8 +20,8 @@ Gem::Specification.new do |s|
20
20
  "Rakefile",
21
21
  "fancy-buttons.gemspec",
22
22
  "lib/fancy-buttons.rb",
23
- "lib/sass/_fancy_buttons.sass",
24
- "lib/sass/_fancy_gradient.sass",
23
+ "lib/stylesheets/_fancy_buttons.sass",
24
+ "lib/stylesheets/_fancy_gradient.sass",
25
25
  "lib/templates/project/button_bg.png",
26
26
  "lib/templates/project/buttons.sass",
27
27
  "lib/templates/project/ie6.sass",
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
31
31
  s.homepage = %q{http://github.com/imathis/fancy-buttons}
32
32
  s.rdoc_options = ["--charset=UTF-8"]
33
33
  s.require_paths = ["lib"]
34
- s.rubygems_version = %q{1.3.5}
34
+ s.rubygems_version = %q{1.3.6}
35
35
  s.summary = %q{Make fancy buttons with the Compass stylesheet authoring framework.}
36
36
 
37
37
  if s.respond_to? :specification_version then
@@ -39,17 +39,15 @@ Gem::Specification.new do |s|
39
39
  s.specification_version = 3
40
40
 
41
41
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
42
- s.add_runtime_dependency(%q<haml>, [">= 2.2.14"])
43
- s.add_runtime_dependency(%q<compass>, [">= 0.10.0.pre8"])
44
- s.add_runtime_dependency(%q<compass-colors>, [">= 0.3.1"])
42
+ s.add_runtime_dependency(%q<haml>, [">= 3.0.0.beta.3"])
43
+ s.add_runtime_dependency(%q<compass>, [">= 0.10.0.rc3"])
45
44
  else
46
- s.add_dependency(%q<haml>, [">= 2.2.14"])
47
- s.add_dependency(%q<compass>, [">= 0.10.0.pre8"])
48
- s.add_dependency(%q<compass-colors>, [">= 0.3.1"])
45
+ s.add_dependency(%q<haml>, [">= 3.0.0.beta.3"])
46
+ s.add_dependency(%q<compass>, [">= 0.10.0.rc3"])
49
47
  end
50
48
  else
51
- s.add_dependency(%q<haml>, [">= 2.2.14"])
52
- s.add_dependency(%q<compass>, [">= 0.10.0.pre8"])
53
- s.add_dependency(%q<compass-colors>, [">= 0.3.1"])
49
+ s.add_dependency(%q<haml>, [">= 3.0.0.beta.3"])
50
+ s.add_dependency(%q<compass>, [">= 0.10.0.rc3"])
54
51
  end
55
52
  end
53
+
@@ -1,3 +1,3 @@
1
1
  Compass::Frameworks.register('fancy-buttons',
2
- :stylesheets_directory => File.join(File.dirname(__FILE__), 'sass'),
2
+ :stylesheets_directory => File.join(File.dirname(__FILE__), 'stylesheets'),
3
3
  :templates_directory => File.join(File.dirname(__FILE__), 'templates'))
@@ -0,0 +1,172 @@
1
+ @import compass/css3
2
+ @import fancy_gradient
3
+
4
+ $fb_gradient_style: glossy !default
5
+ $fb_invert_on_click: 1 !default
6
+ $fb_font_size: 18px !default
7
+ $fb_color: #444444 !default
8
+ $fb_font_weight: bold !default
9
+ $fb_border_width: 1px !default
10
+ $fb_radius: 6px !default
11
+ $fb_light_text: white !default
12
+ $fb_dark_text: #222222 !default
13
+ $fb_gradient: 1 !default
14
+ $fb_image_path: image_url("button_bg.png") !default
15
+
16
+ // Make a fancy button.
17
+ =fancy-button($color: $fb_color, $font_size: $fb_font_size, $radius: $fb_radius, $border_width: $fb_border_width)
18
+ +fancy-button-structure($font_size, $radius, $border_width)
19
+ +fancy-button-colors($color)
20
+
21
+ // 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
+ +fb-color($color, "default")
24
+ &.disabled:active, &.disabled:hover, &[disabled]:active, &[disabled]:hover
25
+ +fb-color($color, "default")
26
+ &:hover, &:focus
27
+ @if $hover == 0
28
+ +fb-color(darken($color, 3), "hover", $color)
29
+ @else
30
+ +fb-color($hover, "hover")
31
+ &:active
32
+ @if $active == 0
33
+ +fb-color(darken($color, 6), "active", $color)
34
+ @else
35
+ +fb-color($active, "active")
36
+
37
+ =fancy-button-matte($color: $fb_color, $font_size: $fb_font_size, $radius: $fb_radius, $border_width: $fb_border_width)
38
+ +fancy-button-structure($font_size, $radius, $border_width)
39
+ +fancy-button-colors-matte($color)
40
+
41
+ =fancy-button-custom($color: $fb_color, $font_size: $fb_font_size, $radius: $fb_radius, $border_width: $fb_border_width)
42
+ +fancy-button-structure($font_size, $radius, $border_width)
43
+ +fancy-button-colors-custom($color, $font_size, $radius, $border_width)
44
+
45
+ =fancy-button-colors-matte($color: $fb_color, $hover: 0, $active: 0)
46
+ $fb_current_style: $fb_gradient_style
47
+ $fb_gradient_style: matte
48
+ +fancy-button-colors($color, $hover, $active)
49
+ $fb_gradient_style: $fb_current_style
50
+
51
+ =fancy-button-colors-custom($color: $fb_color, $hover: 0, $active: 0)
52
+ $fb_current_style: $fb_gradient_style
53
+ $fb_gradient_style: custom
54
+ +fancy-button-colors($color, $hover, $active)
55
+ $fb_gradient_style: $fb_current_style
56
+
57
+ // Default state color settings
58
+ =fb-color($color, $state, $lumins: $color)
59
+ $gradient_top: lighten($color, 15)
60
+ $gradient_bottom: darken($color, 6)
61
+ $border_color: darken($color, 8)
62
+ @if $fb_invert_on_click != 0
63
+ $border_color: darken($color, 15)
64
+ @if saturation($color) > 0
65
+ $color: saturate($color, 40)
66
+ @else if lightness($lumins) >= lightness(#aaaaaa)
67
+ $color: lighten($color, 20)
68
+ +fb-state-colors($color, $gradient_top, $gradient_bottom, $border_color, $state, $lumins)
69
+
70
+ // Apply the button colors specified for the button state into which it is mixed.
71
+ =fb-state-colors($color, $gradient_top, $gradient_bottom, $border, $state, $lumins: $color)
72
+ background-color: $color
73
+ @if $fb_gradient != 0
74
+ @if $fb_gradient_style == "glossy"
75
+ @if $fb_invert_on_click != 0 and $state == "active"
76
+ +invert-fancy-gradient($gradient_top, $gradient_bottom)
77
+ @else
78
+ +fancy-gradient($gradient_top, $gradient_bottom)
79
+ @else if $fb_gradient_style == "matte"
80
+ @if $fb_invert_on_click and $state == "active"
81
+ +invert-fancy-matte-gradient($gradient_top, $gradient_bottom)
82
+ @else
83
+ +fancy-matte-gradient($gradient_top, $gradient_bottom)
84
+ @else if $fb_gradient_style == "custom"
85
+ @if $fb_invert_on_click and $state == "active"
86
+ +invert-custom-fancy-gradient($gradient_top, $gradient_bottom)
87
+ @else
88
+ +custom-fancy-gradient($gradient_top, $gradient_bottom)
89
+ border:
90
+ color: $border
91
+ $text_shadow_settings: unquote("0px 1px 1px")
92
+ @if $fb_invert_on_click != 0 and $state == "active"
93
+ $text_shadow_settings: unquote("0px -1px -1px")
94
+ @if lightness($lumins) < lightness(#aaaaaa)
95
+ text-shadow: darken($color, 25) $text_shadow_settings
96
+ color: $fb_light_text
97
+ @else
98
+ text-shadow: lighten($color, 15) $text_shadow_settings
99
+ color: $fb_dark_text
100
+
101
+ =fancy-button-text-colors($color, $hover, $active)
102
+ color: $color
103
+ &:hover, &:focus
104
+ color: $hover
105
+ &:active
106
+ color: $active
107
+ &.disabled:active, &.disabled:hover, &[disabled]:active, &[disabled]:hover
108
+ color: $color
109
+
110
+ // Apply this mixin to a nested element to style an arrow
111
+ =fancy-arrow($font_size)
112
+ font-size: $font_size + 4px
113
+ line-height: $font_size - 4px
114
+ margin-left: 4px
115
+
116
+ // Layout the button's box
117
+ =fancy-button-structure($font_size: $fb_font_size, $radius: $fb_radius, $border_width: $fb_border_width, $line_height: $font_size * 1.2)
118
+ +fb-reset
119
+ +fancy-button-size($font_size, $radius, $border_width, $line_height)
120
+
121
+ =fancy-button-size($font_size: $fb_font_size, $radius: $fb_radius, $border_width: $fb_border_width, $line_height: $font_size * 1.2)
122
+ // better padding for smaller buttons
123
+ $v_padding: 0
124
+ $h_padding: 0
125
+ @if $font_size > 15
126
+ $v_padding: floor($font_size / 3.5)
127
+ $h_padding: $font_size
128
+ @else
129
+ $v_padding: floor($font_size / 5)
130
+ $h_padding: floor($font_size / 1.2)
131
+ @if $radius > 0
132
+ +border-radius($radius)
133
+ font-size: $font_size
134
+ line-height: $line_height
135
+ +fancy-button-padding($v_padding, $h_padding, $border_width)
136
+
137
+ =fancy-button-padding($v_padding, $h_padding, $border_width: $fb_border_width)
138
+ $v_padding_active: $v_padding - 1px
139
+ $h_padding_active: $h_padding - 1px
140
+ padding: $v_padding $h_padding
141
+ border-width: $border_width
142
+ &:active
143
+ padding: $v_padding_active $h_padding_active
144
+ border-width: $border_width + 1px
145
+ &.disabled:active, &[disabled]
146
+ padding: $v_padding $h_padding
147
+ border-width: $border_width
148
+
149
+ // Reset the button's important properties to make sure they behave correctly
150
+ =fb-reset($font_weight: $fb_font_weight)
151
+ font-family: "Lucida Grande", Lucida, Arial, sans_serif
152
+ background: #{$fb_image_path} repeat-x bottom left
153
+ margin: 0
154
+ width: auto
155
+ overflow: visible
156
+ display: inline-block
157
+ cursor: pointer
158
+ text-decoration: none
159
+ border-style: solid
160
+ font-weight: $font_weight
161
+ &::-moz-focus-inner
162
+ border: none
163
+ padding: 0
164
+ &:focus
165
+ outline: none
166
+ &.disabled, &[disabled]
167
+ +disable-button
168
+
169
+ =disable-button($opacity: 0.7)
170
+ +opacity($opacity)
171
+ &:hover, &:focus
172
+ cursor: default
@@ -0,0 +1,28 @@
1
+ =fancy-gradient($color1, $color2)
2
+ $top_shine: lighten($color1, 18)
3
+ $bottom_glow: lighten($color2, 10)
4
+ $top_middle: $color1
5
+ $middle: lighten($color2, 3)
6
+ $bottom_middle: $color2
7
+ +linear-gradient(color_stops($top_shine, $top_middle 10%, $middle 50%, $bottom_middle 50%, $bottom_glow))
8
+
9
+ =invert-fancy-gradient($color1, $color2)
10
+ $top: lighten($color2, 6)
11
+ $bottom: lighten($color2, 14)
12
+ $top_middle: lighten($color2, 8)
13
+ $middle: lighten($color2, 4)
14
+ $bottom_middle: lighten($color2, 1)
15
+ +linear-gradient(color_stops($top, $top_middle 30%, $middle 50%, $bottom_middle 50%, $bottom))
16
+
17
+ =fancy-matte-gradient($color1, $color2)
18
+ +linear-gradient(color_stops($color1, $color2))
19
+
20
+ =invert-fancy-matte-gradient($color1, $color2)
21
+ $top: lighten($color2, 5)
22
+ $bottom: lighten($color2, 15)
23
+ $middle: lighten($color2, 8)
24
+ +linear-gradient(color_stops($top, $middle 40%, $middle 85%, $bottom))
25
+
26
+ /* incase an inverted custom gradient isn't specified
27
+ =invert-custom-fancy-gradient($color1, $color2)
28
+ +custom-fancy-gradient($color1, $color2)
@@ -5,7 +5,7 @@ body
5
5
  padding-top: 10px
6
6
  h1, h2, h3
7
7
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif
8
- color: #333
8
+ color: #333333
9
9
  letter-spacing: -1px
10
10
  h1
11
11
  font-size: 50px
@@ -13,46 +13,46 @@ h2
13
13
  font-size: 30px
14
14
  div
15
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)
16
21
 
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)
22
+ =custom-fancy-gradient($color1, $color2)
23
+ +radial-gradient("50% 10%, 10, 50% 10%, 30", $color1, darken($color2, 5))
21
24
 
25
+ =invert-custom-fancy-gradient($color1, $color2)
26
+ +custom-fancy-gradient(lighten($color2, 10), lighten($color2, 25))
22
27
 
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
28
+ a.button, button
29
29
  +fancy-button-structure
30
30
  +fancy-button-colors
31
31
  margin: 0 2px
32
32
  vertical-align: middle
33
33
  &.light
34
- +fancy-button-colors-matte(#ddd)
34
+ +fancy-button-colors-matte(#dddddd)
35
35
  &.matte-blue
36
- +fancy-button-colors-matte(!blue)
36
+ +fancy-button-colors-matte($blue)
37
37
  &.green
38
- +fancy-button-colors(!green)
38
+ +fancy-button-colors($green)
39
39
  &.blue
40
40
  +fancy-button-size(32px, 32px, 3px)
41
- +fancy-button-colors(!blue)
41
+ +fancy-button-colors($blue)
42
42
  &.red
43
- +fancy-button-colors(!red)
43
+ +fancy-button-colors($red)
44
44
  &.yellow
45
45
  +fancy-button-colors(darken(desaturate(yellow, 35), 5))
46
46
  &.custom
47
47
  +fancy-button-size(30px, 10px)
48
48
  +fancy-button-padding(2px, 12px, 2px)
49
49
  &.heart
50
- +fancy-button-colors-custom(!heart_button)
50
+ +fancy-button-colors-custom($heart_button)
51
51
  &.arrow
52
52
  +fancy-button-size(30px, 30px)
53
- +fancy-button-colors-custom(#ddd)
53
+ +fancy-button-colors-custom(#dddddd)
54
54
  +fancy-button-padding(2px, 6px, 2px)
55
55
  &.spade
56
- +fancy-button-colors-custom(!blue)
56
+ +fancy-button-colors-custom($blue)
57
57
  +fancy-button-padding(2px, 8px, 2px)
58
58
  //color: #333 !important
@@ -1,4 +1,11 @@
1
- stylesheet 'buttons.sass', :media => 'screen, projection'
2
- stylesheet 'ie6.sass', :media => 'screen, projection', :condition => "lt IE 8"
1
+ # Make sure you list all the project template files here in the manifest.
2
+ stylesheet 'ie6.sass', :media => 'screen, projection', :condition => "lt IE 7"
3
3
  image 'button_bg.png'
4
- file 'index.html'
4
+
5
+ #print "Install example files? (html and buttons.sass) (Y/n)?"
6
+ #response = gets
7
+ #if response.downcase == "y" || response.downcase == "\n"
8
+ file 'index.html'
9
+ stylesheet 'buttons.sass', :media => 'screen, projection'
10
+ #end
11
+ #print 'Don\'t forget to @import "fancy-buttons"'
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fancy-buttons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 5
8
+ - 0
9
+ version: 0.5.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - Brandon Mathis
@@ -9,39 +14,40 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-02-25 00:00:00 -06:00
17
+ date: 2010-04-24 00:00:00 -05:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: haml
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
23
- version: 2.2.14
24
- version:
27
+ segments:
28
+ - 3
29
+ - 0
30
+ - 0
31
+ - beta
32
+ - 3
33
+ version: 3.0.0.beta.3
34
+ type: :runtime
35
+ version_requirements: *id001
25
36
  - !ruby/object:Gem::Dependency
26
37
  name: compass
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
38
+ prerelease: false
39
+ requirement: &id002 !ruby/object:Gem::Requirement
30
40
  requirements:
31
41
  - - ">="
32
42
  - !ruby/object:Gem::Version
33
- version: 0.10.0.pre8
34
- version:
35
- - !ruby/object:Gem::Dependency
36
- name: compass-colors
43
+ segments:
44
+ - 0
45
+ - 10
46
+ - 0
47
+ - rc3
48
+ version: 0.10.0.rc3
37
49
  type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: 0.3.1
44
- version:
50
+ version_requirements: *id002
45
51
  description: 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.
46
52
  email: brandon@imathis.com
47
53
  executables: []
@@ -55,8 +61,8 @@ files:
55
61
  - Rakefile
56
62
  - fancy-buttons.gemspec
57
63
  - lib/fancy-buttons.rb
58
- - lib/sass/_fancy_buttons.sass
59
- - lib/sass/_fancy_gradient.sass
64
+ - lib/stylesheets/_fancy_buttons.sass
65
+ - lib/stylesheets/_fancy_gradient.sass
60
66
  - lib/templates/project/button_bg.png
61
67
  - lib/templates/project/buttons.sass
62
68
  - lib/templates/project/ie6.sass
@@ -75,18 +81,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
81
  requirements:
76
82
  - - ">="
77
83
  - !ruby/object:Gem::Version
84
+ segments:
85
+ - 0
78
86
  version: "0"
79
- version:
80
87
  required_rubygems_version: !ruby/object:Gem::Requirement
81
88
  requirements:
82
89
  - - ">="
83
90
  - !ruby/object:Gem::Version
91
+ segments:
92
+ - 0
84
93
  version: "0"
85
- version:
86
94
  requirements: []
87
95
 
88
96
  rubyforge_project:
89
- rubygems_version: 1.3.5
97
+ rubygems_version: 1.3.6
90
98
  signing_key:
91
99
  specification_version: 3
92
100
  summary: Make fancy buttons with the Compass stylesheet authoring framework.
@@ -1,173 +0,0 @@
1
- @import compass/css3.sass
2
- @import fancy_gradient.sass
3
-
4
- !fb_gradient_style ||= "glossy"
5
- !fb_invert_on_click ||= 1
6
- !fb_font_size ||= 18px
7
- !fb_color ||= #444
8
- !fb_font_weight ||= "bold"
9
- !fb_border_width ||= 1px
10
- !fb_radius ||= 6px
11
- !fb_light_text ||= #fff
12
- !fb_dark_text ||= #222
13
- !fb_gradient ||= 1
14
- !fb_image_path ||= image_url("button_bg.png")
15
-
16
- // Make a fancy button.
17
- =fancy-button(!color= !fb_color, !font_size= !fb_font_size, !radius= !fb_radius, !border_width= !fb_border_width)
18
- +fancy-button-structure(!font_size, !radius, !border_width)
19
- +fancy-button-colors(!color)
20
-
21
- // 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
- +fb-color(!color, "default")
24
- &.disabled:active, &.disabled:hover, &[disabled]:active, &[disabled]:hover
25
- +fb-color(!color, "default")
26
- &:hover, &:focus
27
- @if !hover == 0
28
- +fb-color(darken(!color, 3), "hover", !color)
29
- @else
30
- +fb-color(!hover, "hover")
31
- &:active
32
- @if !active == 0
33
- +fb-color(darken(!color, 6), "active", !color)
34
- @else
35
- +fb-color(!active, "active")
36
-
37
- =fancy-button-matte(!color= !fb_color, !font_size= !fb_font_size, !radius= !fb_radius, !border_width= !fb_border_width)
38
- +fancy-button-structure(!font_size, !radius, !border_width)
39
- +fancy-button-colors-matte(!color)
40
-
41
- =fancy-button-custom(!color= !fb_color, !font_size= !fb_font_size, !radius= !fb_radius, !border_width= !fb_border_width)
42
- +fancy-button-structure(!font_size, !radius, !border_width)
43
- +fancy-button-colors-custom(!color, !font_size, !radius, !border_width)
44
-
45
- =fancy-button-colors-matte(!color = !fb_color, !hover = 0, !active = 0)
46
- !fb_current_style = !fb_gradient_style
47
- !fb_gradient_style = "matte"
48
- +fancy-button-colors(!color, !hover, !active)
49
- !fb_gradient_style = !fb_current_style
50
-
51
- =fancy-button-colors-custom(!color = !fb_color, !hover = 0, !active = 0)
52
- !fb_current_style = !fb_gradient_style
53
- !fb_gradient_style = "custom"
54
- +fancy-button-colors(!color, !hover, !active)
55
- !fb_gradient_style = !fb_current_style
56
-
57
- // Default state color settings
58
- =fb-color(!color, !state, !lumins = !color)
59
- !gradient_top = lighten(!color, 15)
60
- !gradient_bottom = darken(!color, 06)
61
- !border_color = darken(!color, 08)
62
- @if !fb_invert_on_click != 0
63
- !border_color = darken(!color, 15)
64
- @if saturation(!color) > 0
65
- !color = saturate(!color, 40)
66
- @else if luminosity(!lumins) >= luminosity(#aaa)
67
- !color = lighten(!color, 20)
68
- +fb-state-colors(!color, !gradient_top, !gradient_bottom, !border_color, !state, !lumins)
69
-
70
- // Apply the button colors specified for the button state into which it is mixed.
71
- =fb-state-colors(!color, !gradient_top, !gradient_bottom, !border, !state, !lumins = !color)
72
- background-color= !color
73
- @if !fb_gradient != 0
74
- @if !fb_gradient_style == "glossy"
75
- @if !fb_invert_on_click != 0 and !state == "active"
76
- +invert-fancy-gradient(!gradient_top, !gradient_bottom)
77
- @else
78
- +fancy-gradient(!gradient_top, !gradient_bottom)
79
- @else if !fb_gradient_style == "matte"
80
- @if !fb_invert_on_click and !state == "active"
81
- +invert-fancy-matte-gradient(!gradient_top, !gradient_bottom)
82
- @else
83
- +fancy-matte-gradient(!gradient_top, !gradient_bottom)
84
- @else if !fb_gradient_style == "custom"
85
- @if !fb_invert_on_click and !state == "active"
86
- +invert-custom-fancy-gradient(!gradient_top, !gradient_bottom)
87
- @else
88
- +custom-fancy-gradient(!gradient_top, !gradient_bottom)
89
- border:
90
- color= !border
91
- !text_shadow_settings = "0px 1px 1px"
92
- @if !fb_invert_on_click != 0 and !state == "active"
93
- !text_shadow_settings = "0px -1px -1px"
94
- @if luminosity(!lumins) < luminosity(#aaa)
95
- text-shadow= darken(!color, 25) !text_shadow_settings
96
- color= !fb_light_text
97
- @else
98
- text-shadow= lighten(!color, 15) !text_shadow_settings
99
- color= !fb_dark_text
100
-
101
- =fancy-button-text-colors(!color, !hover, !active)
102
- color= !color
103
- &:hover, &:focus
104
- color= !hover
105
- &:active
106
- color= !active
107
- &.disabled:active, &.disabled:hover, &[disabled]:active, &[disabled]:hover
108
- color= !color
109
-
110
- // Apply this mixin to a nested element to style an arrow
111
- =fancy-arrow(!font_size)
112
- font-size= !font_size + 4px
113
- line-height= !font_size - 4px
114
- margin-left= 4px
115
-
116
- // Layout the button's box
117
- =fancy-button-structure(!font_size = !fb_font_size, !radius = !fb_radius, !border_width = !fb_border_width, !line_height = !font_size * 1.2)
118
- +fb-reset
119
- +fancy-button-size(!font_size, !radius, !border_width, !line_height)
120
-
121
- =fancy-button-size(!font_size = !fb_font_size, !radius = !fb_radius, !border_width = !fb_border_width, !line_height = !font_size * 1.2)
122
- // better padding for smaller buttons
123
- !v_padding = 0
124
- !h_padding = 0
125
- @if !font_size > 15
126
- !v_padding = floor(!font_size/3.5)
127
- !h_padding = !font_size
128
- @else
129
- !v_padding = floor(!font_size/5)
130
- !h_padding = floor(!font_size/1.2)
131
-
132
- @if !radius > 0
133
- +border-radius(!radius)
134
- font-size= !font_size
135
- line-height= !line_height
136
- +fancy-button-padding(!v_padding, !h_padding, !border_width)
137
-
138
- =fancy-button-padding(!v_padding, !h_padding, !border_width = !fb_border_width)
139
- !v_padding_active = !v_padding - 1px
140
- !h_padding_active = !h_padding - 1px
141
- padding= !v_padding !h_padding
142
- border-width= !border_width
143
- &:active
144
- padding= !v_padding_active !h_padding_active
145
- border-width= !border_width + 1px
146
- &.disabled:active, &[disabled]
147
- padding= !v_padding !h_padding
148
- border-width= !border_width
149
-
150
- // Reset the button's important properties to make sure they behave correctly
151
- =fb-reset(!font_weight = !fb_font_weight)
152
- font-family: "Lucida Grande", Lucida, Arial, sans_serif
153
- background: #{!fb_image_path} repeat-x bottom left
154
- margin: 0
155
- width: auto
156
- overflow: visible
157
- display: inline-block
158
- cursor: pointer
159
- text-decoration: none
160
- border-style: solid
161
- font-weight= !font_weight
162
- &::-moz-focus-inner
163
- border: none
164
- padding: 0
165
- &:focus
166
- outline: none
167
- &.disabled, &[disabled]
168
- +disable-button
169
-
170
- =disable-button(!opacity = .7)
171
- +opacity(!opacity)
172
- &:hover, &:focus
173
- cursor: default
@@ -1,28 +0,0 @@
1
- =fancy-gradient(!color1, !color2)
2
- !top_shine = lighten(!color1, 18)
3
- !bottom_glow = lighten(!color2, 10)
4
- !top_middle = !color1
5
- !middle = lighten(!color2, 3)
6
- !bottom_middle = !color2
7
- +linear-gradient(color_stops(!top_shine, !top_middle 10%, !middle 50%, !bottom_middle 50%, !bottom_glow))
8
-
9
- =invert-fancy-gradient(!color1, !color2)
10
- !top = lighten(!color2, 6)
11
- !bottom = lighten(!color2, 14)
12
- !top_middle = lighten(!color2, 8)
13
- !middle = lighten(!color2, 4)
14
- !bottom_middle = lighten(!color2, 1)
15
- +linear-gradient(color_stops(!top, !top_middle 30%, !middle 50%, !bottom_middle 50%, !bottom))
16
-
17
- =fancy-matte-gradient(!color1, !color2)
18
- +linear-gradient(color_stops(!color1, !color2))
19
-
20
- =invert-fancy-matte-gradient(!color1, !color2)
21
- !top = lighten(!color2, 5)
22
- !bottom = lighten(!color2, 15)
23
- !middle = lighten(!color2, 8)
24
- +linear-gradient(color_stops(!top, !middle 40%, !middle 85%, !bottom))
25
-
26
- /* incase an inverted custom gradient isn't specified */
27
- =invert-custom-fancy-gradient(!color1, !color2)
28
- +custom-fancy-gradient(!color1, !color2)