fancy-buttons 0.5.5 → 0.6.0.pre1
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/fancy-buttons.gemspec +3 -3
- data/lib/stylesheets/_fancy-buttons.sass +93 -108
- metadata +13 -10
data/fancy-buttons.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{fancy-buttons}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.6.0.pre1"
|
9
9
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brandon Mathis"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-08-17}
|
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 = [
|
@@ -1,30 +1,28 @@
|
|
1
1
|
@import compass/css3
|
2
2
|
@import fancy-gradient
|
3
3
|
|
4
|
-
$
|
5
|
-
$
|
6
|
-
$
|
7
|
-
$
|
8
|
-
$
|
9
|
-
$
|
10
|
-
$
|
11
|
-
$
|
12
|
-
$
|
13
|
-
$
|
14
|
-
$
|
15
|
-
$
|
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
|
+
$fb-allow-disabled: false !default
|
16
|
+
$fb-line-height: 1.2em !default
|
16
17
|
|
17
18
|
// Make a fancy button.
|
18
|
-
=fancy-button($color: $
|
19
|
-
+fancy-button-structure($
|
19
|
+
=fancy-button($color: $fb-color, $font-size: $fb-font-size, $radius: $fb-radius, $border-width: $fb-border-width)
|
20
|
+
+fancy-button-structure($font-size, $radius, $border-width)
|
20
21
|
+fancy-button-colors($color)
|
21
22
|
|
22
23
|
// Style the button's colors, picking the most appropriate color set for the base color.
|
23
|
-
=fancy-button-colors($color: $
|
24
|
+
=fancy-button-colors($color: $fb-color, $hover: 0, $active: 0, $allow-disabled: $fb-allow-disabled)
|
24
25
|
+fb-color($color, "default")
|
25
|
-
@if $allow_disabled
|
26
|
-
&.disabled:active, &.disabled:hover, &[disabled]:active, &[disabled]:hover
|
27
|
-
+fb-color($color, "default")
|
28
26
|
&:hover, &:focus
|
29
27
|
@if $hover == 0
|
30
28
|
+fb-color(darken($color, 3), "hover", $color)
|
@@ -35,132 +33,119 @@ $fb_allow_disabled: true !default
|
|
35
33
|
+fb-color(darken($color, 6), "active", $color)
|
36
34
|
@else
|
37
35
|
+fb-color($active, "active")
|
36
|
+
@if $allow-disabled
|
37
|
+
&.disabled, &[disabled]
|
38
|
+
+disable-fancy-button($color)
|
39
|
+
|
40
|
+
=fancy-button-allow-disable($color: $fb-color, $font-size: $fb-font-size, $radius: $fb-radius, $border-width: $fb-border-width)
|
41
|
+
$fb-disable-allowed: $fb-allow-disable
|
42
|
+
$fb-allow-disable: true
|
43
|
+
+fancy-button-structure($font-size, $radius, $border-width)
|
44
|
+
+fancy-button-colors-matte($color)
|
45
|
+
$fb-allow-disable: $fb-disable-allowed
|
38
46
|
|
39
|
-
=fancy-button-matte($color: $
|
40
|
-
+fancy-button-structure($
|
47
|
+
=fancy-button-matte($color: $fb-color, $font-size: $fb-font-size, $radius: $fb-radius, $border-width: $fb-border-width)
|
48
|
+
+fancy-button-structure($font-size, $radius, $border-width)
|
41
49
|
+fancy-button-colors-matte($color)
|
42
50
|
|
43
|
-
=fancy-button-custom($color: $
|
44
|
-
+fancy-button-structure($
|
45
|
-
+fancy-button-colors-custom($color, $
|
51
|
+
=fancy-button-custom($color: $fb-color, $font-size: $fb-font-size, $radius: $fb-radius, $border-width: $fb-border-width)
|
52
|
+
+fancy-button-structure($font-size, $radius, $border-width)
|
53
|
+
+fancy-button-colors-custom($color, $font-size, $radius, $border-width)
|
46
54
|
|
47
|
-
=fancy-button-colors-matte($color: $
|
48
|
-
$
|
49
|
-
$
|
55
|
+
=fancy-button-colors-matte($color: $fb-color, $hover: 0, $active: 0)
|
56
|
+
$fb-current-style: $fb-gradient-style
|
57
|
+
$fb-gradient-style: matte
|
50
58
|
+fancy-button-colors($color, $hover, $active)
|
51
|
-
$
|
59
|
+
$fb-gradient-style: $fb-current-style
|
52
60
|
|
53
|
-
=fancy-button-colors-custom($color: $
|
54
|
-
$
|
55
|
-
$
|
61
|
+
=fancy-button-colors-custom($color: $fb-color, $hover: 0, $active: 0)
|
62
|
+
$fb-current-style: $fb-gradient-style
|
63
|
+
$fb-gradient-style: custom
|
56
64
|
+fancy-button-colors($color, $hover, $active)
|
57
|
-
$
|
65
|
+
$fb-gradient-style: $fb-current-style
|
58
66
|
|
59
67
|
// Default state color settings
|
60
68
|
=fb-color($color, $state, $lumins: $color)
|
61
|
-
$
|
62
|
-
$
|
63
|
-
$
|
64
|
-
@if $
|
65
|
-
$
|
69
|
+
$gradient-top: lighten($color, 15)
|
70
|
+
$gradient-bottom: darken($color, 6)
|
71
|
+
$border-color: darken($color, 8)
|
72
|
+
@if $fb-invert-on-click != 0
|
73
|
+
$border-color: darken($color, 15)
|
66
74
|
@if saturation($color) > 0
|
67
75
|
$color: saturate($color, 40)
|
68
76
|
@else if lightness($lumins) >= lightness(#aaaaaa)
|
69
77
|
$color: lighten($color, 20)
|
70
|
-
+fb-state-colors($color, $
|
78
|
+
+fb-state-colors($color, $gradient-top, $gradient-bottom, $border-color, $state, $lumins)
|
71
79
|
|
72
80
|
// Apply the button colors specified for the button state into which it is mixed.
|
73
|
-
=fb-state-colors($color, $
|
81
|
+
=fb-state-colors($color, $gradient-top, $gradient-bottom, $border, $state, $lumins: $color)
|
74
82
|
background-color: $color
|
75
|
-
@if $
|
76
|
-
@if $
|
77
|
-
@if $
|
78
|
-
+invert-fancy-gradient($
|
83
|
+
@if $fb-gradient != 0
|
84
|
+
@if $fb-gradient-style == "glossy"
|
85
|
+
@if $fb-invert-on-click != 0 and $state == "active"
|
86
|
+
+invert-fancy-gradient($gradient-top, $gradient-bottom)
|
79
87
|
@else
|
80
|
-
+fancy-gradient($
|
81
|
-
@else if $
|
82
|
-
@if $
|
83
|
-
+invert-fancy-matte-gradient($
|
88
|
+
+fancy-gradient($gradient-top, $gradient-bottom)
|
89
|
+
@else if $fb-gradient-style == "matte"
|
90
|
+
@if $fb-invert-on-click and $state == "active"
|
91
|
+
+invert-fancy-matte-gradient($gradient-top, $gradient-bottom)
|
84
92
|
@else
|
85
|
-
+fancy-matte-gradient($
|
86
|
-
@else if $
|
87
|
-
@if $
|
88
|
-
+invert-custom-fancy-gradient($
|
93
|
+
+fancy-matte-gradient($gradient-top, $gradient-bottom)
|
94
|
+
@else if $fb-gradient-style == "custom"
|
95
|
+
@if $fb-invert-on-click and $state == "active"
|
96
|
+
+invert-custom-fancy-gradient($gradient-top, $gradient-bottom)
|
89
97
|
@else
|
90
|
-
+custom-fancy-gradient($
|
98
|
+
+custom-fancy-gradient($gradient-top, $gradient-bottom)
|
91
99
|
border:
|
92
100
|
color: $border
|
93
|
-
$
|
94
|
-
@if $
|
95
|
-
$
|
101
|
+
$text-shadow-settings: unquote("0px 1px 1px")
|
102
|
+
@if $fb-invert-on-click != 0 and $state == "active"
|
103
|
+
$text-shadow-settings: unquote("0px -1px -1px")
|
96
104
|
@if lightness($lumins) < lightness(#aaaaaa)
|
97
|
-
text-shadow: darken($color, 25) $
|
105
|
+
text-shadow: darken($color, 25) $text-shadow-settings
|
98
106
|
&, &:visited
|
99
|
-
color: $
|
107
|
+
color: $fb-light-text
|
100
108
|
@else
|
101
|
-
text-shadow: lighten($color, 15) $
|
109
|
+
text-shadow: lighten($color, 15) $text-shadow-settings
|
102
110
|
&, &:visited
|
103
|
-
color: $
|
111
|
+
color: $fb-dark-text
|
104
112
|
|
105
113
|
=fancy-button-text-colors($color, $hover, $active, $allow-disabled : $fb-allow-disabled)
|
106
|
-
|
114
|
+
&, &:visited
|
115
|
+
color: $color
|
107
116
|
@if $hover != $color
|
108
117
|
&:hover, &:focus
|
109
118
|
color: $hover
|
110
119
|
@if $active != $color
|
111
120
|
&:active
|
112
121
|
color: $active
|
113
|
-
@if $allow-disabled
|
114
|
-
&.disabled
|
115
|
-
color: $color
|
116
|
-
@if $allow-disabled and $hover != $color
|
117
|
-
&.disabled:hover, &[disabled]:hover
|
122
|
+
@if $allow-disabled
|
123
|
+
&.disabled, &[disabled]
|
118
124
|
color: $color
|
119
125
|
|
120
|
-
// Apply this mixin to a nested element to style an arrow
|
121
|
-
=fancy-arrow($font_size)
|
122
|
-
font-size: $font_size + 4px
|
123
|
-
line-height: $font_size - 4px
|
124
|
-
margin-left: 4px
|
125
|
-
|
126
126
|
// Layout the button's box
|
127
|
-
=fancy-button-structure($
|
128
|
-
|
129
|
-
+fancy-button-size($
|
127
|
+
=fancy-button-structure($font-size: $fb-font-size, $radius: $fb-radius, $border-width: $fb-border-width, $line-height: $fb-line-height)
|
128
|
+
@extend .fancy-button-reset-base-class
|
129
|
+
+fancy-button-size($font-size, $radius, $border-width, $line-height)
|
130
130
|
|
131
|
-
=fancy-button-size($
|
131
|
+
=fancy-button-size($font-size: $fb-font-size, $radius: $fb-radius, $border-width: $fb-border-width, $line-height: $fb-line-height)
|
132
132
|
// better padding for smaller buttons
|
133
|
-
$
|
134
|
-
$
|
135
|
-
@if $font_size > 15
|
136
|
-
$v_padding: floor($font_size / 3.5)
|
137
|
-
$h_padding: $font_size
|
138
|
-
@else
|
139
|
-
$v_padding: floor($font_size / 5)
|
140
|
-
$h_padding: floor($font_size / 1.2)
|
133
|
+
$v-padding: 0.3em
|
134
|
+
$h-padding: 1em
|
141
135
|
@if $radius > 0
|
142
136
|
+border-radius($radius)
|
143
|
-
font-size: $
|
144
|
-
line-height: $
|
145
|
-
+fancy-button-padding($
|
146
|
-
|
147
|
-
=fancy-button-padding($
|
148
|
-
|
149
|
-
|
150
|
-
padding: $v_padding $h_padding
|
151
|
-
border-width: $border_width
|
152
|
-
&:active
|
153
|
-
padding: $v_padding_active $h_padding_active
|
154
|
-
border-width: $border_width + 1px
|
155
|
-
@if $allow_disabled
|
156
|
-
&.disabled:active, &[disabled]
|
157
|
-
padding: $v_padding $h_padding
|
158
|
-
border-width: $border_width
|
137
|
+
font-size: $font-size
|
138
|
+
line-height: $line-height
|
139
|
+
+fancy-button-padding($v-padding, $h-padding, $border-width)
|
140
|
+
|
141
|
+
=fancy-button-padding($v-padding, $h-padding, $border-width: $fb-border-width)
|
142
|
+
padding: $v-padding $h-padding
|
143
|
+
border-width: $border-width
|
159
144
|
|
160
145
|
// Reset the button's important properties to make sure they behave correctly
|
161
|
-
=fb-reset($
|
162
|
-
font-family: "Lucida Grande", Lucida, Arial,
|
163
|
-
background: #{$
|
146
|
+
=fb-reset($font-weight: $fb-font-weight, $allow-disabled: $fb-allow-disabled)
|
147
|
+
font-family: "Lucida Grande", Lucida, Arial, sans-serif
|
148
|
+
background: #{$fb-image-path} repeat-x bottom left
|
164
149
|
margin: 0
|
165
150
|
width: auto
|
166
151
|
overflow: visible
|
@@ -168,17 +153,17 @@ $fb_allow_disabled: true !default
|
|
168
153
|
cursor: pointer
|
169
154
|
text-decoration: none
|
170
155
|
border-style: solid
|
171
|
-
font-weight: $
|
156
|
+
font-weight: $font-weight
|
172
157
|
&::-moz-focus-inner
|
173
158
|
border: none
|
174
159
|
padding: 0
|
175
160
|
&:focus
|
176
161
|
outline: none
|
177
|
-
@if $fb_allow_disabled
|
178
|
-
&.disabled, &[disabled]
|
179
|
-
+disable-button
|
180
162
|
|
181
|
-
=disable-button($opacity: 0.7)
|
163
|
+
=disable-fancy-button($color: $fb-color, $opacity: 0.7)
|
164
|
+
+fb-color($color, "default")
|
182
165
|
+opacity($opacity)
|
183
|
-
|
184
|
-
|
166
|
+
cursor: default !important
|
167
|
+
|
168
|
+
.fancy-button-reset-base-class
|
169
|
+
+fb-reset
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fancy-buttons
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: -1876988208
|
5
|
+
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
- pre1
|
11
|
+
version: 0.6.0.pre1
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Brandon Mathis
|
@@ -15,7 +16,7 @@ autorequire:
|
|
15
16
|
bindir: bin
|
16
17
|
cert_chain: []
|
17
18
|
|
18
|
-
date: 2010-
|
19
|
+
date: 2010-08-17 00:00:00 -05:00
|
19
20
|
default_executable:
|
20
21
|
dependencies:
|
21
22
|
- !ruby/object:Gem::Dependency
|
@@ -90,12 +91,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
91
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
92
|
none: false
|
92
93
|
requirements:
|
93
|
-
- - "
|
94
|
+
- - ">"
|
94
95
|
- !ruby/object:Gem::Version
|
95
|
-
hash:
|
96
|
+
hash: 25
|
96
97
|
segments:
|
97
|
-
-
|
98
|
-
|
98
|
+
- 1
|
99
|
+
- 3
|
100
|
+
- 1
|
101
|
+
version: 1.3.1
|
99
102
|
requirements: []
|
100
103
|
|
101
104
|
rubyforge_project:
|