sassy-buttons 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.mkdn CHANGED
@@ -1,7 +1,7 @@
1
- Compass CSS Sassy Buttons
1
+ Compass CSS Sassy Buttons
2
2
  =========================
3
3
 
4
- Super sassy and super easy CSS3 buttons.
4
+ Super sassy and super easy CSS3 buttons.
5
5
 
6
6
  ![sassy buttons](http://dl.dropbox.com/u/1274637/sassy-buttons.png)
7
7
 
@@ -12,25 +12,17 @@ Installation
12
12
 
13
13
  Install gem from the command line:
14
14
 
15
- sudo gem install sassy-buttons
15
+ (sudo) gem install sassy-buttons
16
16
 
17
- Create a new project using Sassy Buttons
17
+ Installing Sassy Buttons:
18
18
 
19
- compass create project_name -r sassy-buttons --using sassy-buttons
20
-
21
- #import sassy buttons into your sass/scss file
22
- @import "sassybuttons"
23
-
24
-
25
- Adding Sassy Buttons to an exiting project:
26
-
27
19
  # Edit the project configuration file and add:
28
20
  require 'sassy-buttons'
29
-
21
+
30
22
  # From the command line:
31
- compass install sassy-buttons
32
-
33
- #import sassy buttons into your sass/scss file
23
+ compass install -r sassy-buttons -f sassy-buttons
24
+
25
+ #import sassy buttons partial into your sass/scss file
34
26
  @import "sassybuttons"
35
27
 
36
28
 
@@ -38,17 +30,18 @@ Using Sassy Buttons
38
30
  ===================
39
31
 
40
32
  The Sassy Button mixin
41
-
42
- # The simplest form of the mixin using the provided defaults (See Defaults section below)
33
+
34
+ # The simplest form of the mixin using the provided defaults (See Defaults section below)
43
35
  @include sassy-button
44
-
45
- # The Sassy Button mixin takes optional arguments that you can use to customise your buttons on the fly
46
- # This will create a button with a blue matte stlye gradient, with a 15px border radius, 20px font size
36
+
37
+ # The Sassy Button mixin takes optional arguments that you can use to customize your buttons on the fly
38
+ # This will create a button with a blue matte style gradient, with a 15px border radius, 20px font size
47
39
  @include sassy-button("matte", 15px, 20px, rgba(11, 153, 194, 1))
48
40
 
49
- # The complete Sassy Button mixin syntax
50
- @include sassy-button(gradient style, border radius, font size, first color, second color, text color, text style, auto hover)
51
-
41
+ # The complete Sassy Button mixin syntax
42
+ @include sassy-button(gradient-style, border-radius, font-size, first-color, second-color, text-color, text-style, auto-states)
43
+
44
+
52
45
 
53
46
  Sassy Buttons Gradient Styles
54
47
  ----------------------------
@@ -58,7 +51,7 @@ Sassy buttons offer five gradient styles for your buttons. These gradients are g
58
51
  * Matte - A gradient that adds depth but retains a matte finish.
59
52
  * Shiny - A gradient that has a larger highlight area that gives a shinier look.
60
53
  * Glass - A gradient that provides a glass finish
61
- * Flat - No gradient, button will be given first color provided.
54
+ * Flat - No gradient, button will be given first color provided.
62
55
 
63
56
  Sassy Buttons Text Styles
64
57
  -------------------------
@@ -73,36 +66,34 @@ Sassy Buttons Defaults
73
66
 
74
67
  The Sassy Buttons extension provides a set of default sass variables that are used in the various mixins to create the buttons. These defaults can be overridden to customize your buttons and has the added benefit of having to provide less arguments when calling the sassy button mixin.
75
68
 
76
- # Available defaults
77
- $sb-base-color: rgba(11,153,194,1) // Base color of button, used to caluclate graident styles.
78
- $sb-second-color: false // Optional secondary color for gradient.
79
- $sb-border-radius: 10px // Border radius of button.
80
- $sb-border-width: 1px // Border width.
81
- $sb-padding: .5em 1.5em // Padding that gives button structure.
82
- $sb-font-size: 16px // Font size.
83
- $sb-line-height: 1.2em // Line Height.
84
- $sb-text-color: #fff // Button font color.
85
- $sb-text-style: "inset" // Style of button text, can be "inset" or "raised" or false.
86
- $sb-gradient-style: "matte" // Gradient style of button, can be "matte", "shiny", "glass", "simple", "flat".
87
- $sb-hover: true // Automatically generate psuedo :hover state styles.
88
-
89
- # Sassy Button structure mixin that gets called everytime you create a sassy button.
90
- # You can add any custom styles you want applied to all your buttons.
91
- @mixin sassy-button-default-structure
92
- display: inline-block
93
- width: auto
94
- height: auto
95
- cursor: pointer
96
-
69
+ # Available defaults
70
+ $sb-base-color: rgba(11,153,194,1) // Base color of button.
71
+ $sb-second-color: false // Optional secondary color for gradient.
72
+ $sb-border-radius: 10px // Border radius of button.
73
+ $sb-padding: .3em 1.5em // Padding that gives button structure.
74
+ $sb-font-size: 16px // Font size.
75
+ $sb-text-color: #fff // Button font color.
76
+ $sb-text-style: "inset" // Style of button text, can be "inset" or "raised" or false.
77
+ $sb-gradient-style: "simple" // Gradient style of button, can be "flat", "glass", "matte", "shiny", or "simple".
78
+ $sb-pseudo-states: true // Automatically generate pseudo state styles.
79
+
80
+ # Sassy Button structure mixin that gets called every time you create a sassy button.
81
+ # You can add any custom styles you want applied to all your buttons.
82
+ @mixin sassy-button-default-sassytructure
83
+ display: inline-block
84
+ cursor: pointer
85
+ line-height: 1.5
86
+
87
+
97
88
  Additional Sassy Button Styles
98
89
  ------------------------------
99
90
 
100
91
  Sassy Buttons provides two mixins that can add a little extra style to your buttons
101
92
 
102
- # Mixin for adding styles to buttons
103
- @include sassy-button-style(style, color)
93
+ # Mixin for adding styles to buttons
94
+ @include sassy-button-style(style, color)
104
95
 
105
- Available styles:
96
+ Available styles:
106
97
 
107
98
  * Inset - box shadow that gives button an inset look.
108
99
  * Push - box shadow that gives button a pushable look.
@@ -111,16 +102,12 @@ Available styles:
111
102
  Available Sassy Buttons Mixins
112
103
  ------------------------------
113
104
 
114
- A sassy button is made up a few different mixins, which all get called by the main sassy button mixin (@include sassy-button). These mixins are available for you to use for advanced control over your buttons.
105
+ A sassy button is made up a few different mixins, which all get called by the main sassy button mixin (@include sassy-button). These mixins are available for you to use for advanced control over your buttons.
115
106
 
116
- # Mixin for the structure of your button (this mixin calls the sassy-button-default structure mixin).
117
- # Example use: Creating a custom button structure to apply color and text style mixins on.
118
- @include sassy-button-structure(border radius, border width, padding, font size, line height)
119
-
120
- # Mixin for the gradient styles
121
- # Example use: You could call this mixin on a :hover or :active state to provide your own styles for those pseudo states.
122
- @include sassy-button-colors(gradient style, first color, second color, auto hover, text-color, text-style)
123
-
124
- # Mixin for text styles
125
- # Example use: Apply a "inset", "raised" text style to a button
126
- @include sassy-button-text-style(first color, second-color text color, text style )
107
+ # Mixin for the structure of your button (this mixin calls the sassy-button-default structure mixin).
108
+ # Example use: Creating a custom button structure to apply color and text style mixins on.
109
+ @include sassy-button-structure(border-radius, font-size, padding)
110
+
111
+ # Mixin for the gradient styles
112
+ # Example use: You could call this mixin on a :hover or :active state to provide your own styles for those pseudo states.
113
+ @include sassy-button-gradient(gradient-style, first-color, second-color, text-color, text-style, auto-states)
data/lib/sassy-buttons.rb CHANGED
@@ -1,3 +1 @@
1
- require 'compass'
2
- extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
3
- Compass::Frameworks.register('sassy-buttons', :path => extension_path)
1
+ Compass::Frameworks.register("sassy-buttons", :path => "#{File.dirname(__FILE__)}/..")
@@ -1,4 +1,4 @@
1
- // Sassy Buttons
1
+ // Sassy Buttons
2
2
  // Compass extension by Jared Hardy - http://www.jaredhardy.com
3
3
 
4
4
  @import "compass/css3/border-radius"
@@ -6,54 +6,45 @@
6
6
  @import "compass/css3/text-shadow"
7
7
  @import "compass/css3/gradient"
8
8
 
9
- @import "sassy-buttons/sassy-button-colors"
9
+ @import "sassy-buttons/sassy-button-gradients"
10
10
  @import "sassy-buttons/sassy-button-styles"
11
11
  @import "sassy-buttons/sassy-button-text"
12
12
  @import "sassy-buttons/sassy-button-pseudo-states"
13
13
 
14
14
 
15
15
  // Sassy Button defaults
16
- // These are the base defaults for the buttons, if you are going to use similar buttons on an entire site changing these
17
- // can save you some time by calling the sassy button mixin with less arguments.
18
-
19
- $sb-base-color: rgba(11,153,194,1) // Base color of button.
20
- $sb-second-color: false // Optional secondary color for gradient.
21
- $sb-border-radius: 10px // Border radius of button.
22
- $sb-border-width: 1px // Border width.
23
- $sb-padding: .5em 1.5em // Padding that gives button structure.
24
- $sb-font-size: 16px // Font size.
25
- $sb-line-height: 1.2em // Line Height.
26
- $sb-text-color: #fff // Button font color.
27
- $sb-text-style: "inset" // Style of button text, can be "inset" or "raised" or false.
28
- $sb-gradient-style: "matte" // Gradient style of button, can be "matte", "shiny", or "glass".
29
- $sb-hover: true // Automatically generate psuedo :hover state styles.
30
- $sb-ieSupport: false // TODO - Better IE support
31
-
32
- // Mixing that gets included when calling the sassy-button-structure if you need any
16
+ // These are the base defaults for the buttons, if you are going to use similar buttons on an entire site changing these
17
+ // can save you some time by calling the sassy button mixin with less arguments.
18
+
19
+ $sb-base-color: rgba(11,153,194,1) // Base color of button.
20
+ $sb-second-color: false // Optional secondary color for gradient.
21
+ $sb-border-radius: 10px // Border radius of button.
22
+ $sb-padding: .3em 1.5em // Padding that gives button structure.
23
+ $sb-font-size: 16px // Font size.
24
+ $sb-text-color: #fff // Button font color.
25
+ $sb-text-style: "inset" // Style of button text, can be "inset" or "raised" or false.
26
+ $sb-gradient-style: "simple" // Gradient style of button, can be "flat", "glass", "matte", "shiny", or "simple".
27
+ $sb-pseudo-states: true // Automatically generate pseudo state styles.
28
+
29
+
30
+ // Mixing that gets included when calling the sassy-button-structure if you need any
33
31
  // styles applied to all your sassy buttons, add it here.
34
- @mixin sassy-button-default-structure
35
- :display inline-block
36
- :width auto
37
- :height auto
38
- :cursor pointer
39
- // IE support that will be coming soon
40
- //@if($sb-ieSupport)
41
- //:background-image image-url(ie-gradient.png)
42
- //:background-repeat repeat-x
32
+ @mixin sassy-button-default-sassytructure
33
+ display: inline-block
34
+ cursor: pointer
35
+ line-height: 1.5
43
36
 
44
37
  // The Sassy Button kitchen sink.
45
- @mixin sassy-button($gradient-style: $sb-gradient-style, $border-radius: $sb-border-radius, $font-size: $sb-font-size, $first-color: $sb-base-color, $second-color: $sb-second-color, $text-color:$sb-text-color, $text-style: $sb-text-style, $auto-hover: $sb-hover)
46
- @include sassy-button-structure($border-radius, $sb-border-width, $sb-padding, $font-size, $sb-line-height)
47
- @include sassy-button-colors($gradient-style, $first-color, $second-color, $auto-hover, $text-color, $text-style)
48
-
49
-
38
+ @mixin sassy-button($gradient-style: $sb-gradient-style, $border-radius: $sb-border-radius, $font-size: $sb-font-size, $first-color: $sb-base-color, $second-color: $sb-second-color, $text-color:$sb-text-color, $text-style: $sb-text-style, $auto-states: $sb-pseudo-states)
39
+ @include sassy-button-structure($border-radius, $font-size, $sb-padding)
40
+ @include sassy-button-gradient($gradient-style, $first-color, $second-color, $text-color, $text-style, $auto-states)
41
+
42
+
43
+
50
44
  // Structure for a sassy button
51
- @mixin sassy-button-structure($border-radius: $sb-border-radius, $border-width: $sb-border-width, $padding: $sb-padding, $font-size: $sb-font-size, $line-height: $sb-line-height)
52
- @include sassy-button-default-structure
53
- :font-size $font-size
54
- :padding $padding
55
- :line-height $line-height
56
- :border-style solid
57
- :border-width $border-width
58
- @include border-radius($border-radius)
59
-
45
+ @mixin sassy-button-structure($border-radius: $sb-border-radius, $font-size: $sb-font-size, $padding: $sb-padding)
46
+ font-size: $font-size
47
+ padding: $padding
48
+ @include sassy-button-default-structure
49
+ @include border-radius($border-radius)
50
+
@@ -0,0 +1,83 @@
1
+ // Mixin that does all the gradient magic
2
+ @import "sassy-button-text"
3
+ @import "sassy-button-shadows"
4
+
5
+ @mixin sassy-button-gradient($style: "matte", $base-color: $sb-base-color, $second-color: false, $text-color: $sb-text-color, $text-style: $sb-text-style, $auto-states: true)
6
+ $first-color: $base-color
7
+ $lightness : lightness($base-color)
8
+ $brightnessDivsor : 1
9
+ @if $lightness > 75
10
+ $brightnessDivsor : 2
11
+
12
+ background-color: $base-color
13
+
14
+ // Matte Gradient Style
15
+ @if $style == "matte"
16
+ $first-color: $base-color
17
+
18
+ @if $second-color == false
19
+ $first-color: lighten($base-color,15%)
20
+ $second-color: $base-color
21
+
22
+ @include background(linear-gradient(color-stops($first-color, $second-color 70%)))
23
+ @include sassy-button-highlight-shadow($first-color)
24
+ border: 1px solid darken($second-color, 5%)
25
+
26
+ @if $auto-states
27
+ @include sassy-pseudo-states($first-color, $second-color, $style)
28
+
29
+ // Shiny Gradient Style
30
+ @if $style == "shiny"
31
+ $first-color: lighten($base-color, 25% / $brightnessDivsor)
32
+
33
+ @if $second-color == false
34
+ $second-color: darken($base-color, 10%)
35
+
36
+ @include background(linear-gradient(color-stops($first-color, $base-color 50%, $second-color)))
37
+ @include sassy-button-highlight-shadow($first-color)
38
+ border: 1px solid darken($second-color, 5%)
39
+
40
+ @if $auto-states
41
+ @include sassy-pseudo-states($first-color, $second-color, $style)
42
+
43
+ // Glass Gradient Style
44
+ @if $style == "glass"
45
+ $first-color: lighten($base-color, 8% / $brightnessDivsor)
46
+
47
+ @if $second-color == false
48
+ $second-color: $base-color
49
+
50
+ @include background(linear-gradient(color-stops($first-color 50%, $base-color 51%)))
51
+ @include sassy-button-highlight-shadow($first-color)
52
+ border: 1px solid darken($second-color, 5%)
53
+
54
+ @if $auto-states
55
+ @include sassy-pseudo-states($first-color, $second-color, $style)
56
+
57
+ // Simple Gradient Style
58
+ @if $style == "simple"
59
+ @if $second-color == false
60
+ $second-color: darken($base-color, 10%)
61
+
62
+ @include background(linear-gradient(color-stops($base-color, $second-color)))
63
+ @include sassy-button-highlight-shadow($first-color)
64
+ border: 1px solid darken($second-color, 5%)
65
+
66
+ @if $auto-states
67
+ @include sassy-pseudo-states($base-color, $second-color, $style)
68
+
69
+ // Flat Style
70
+ @if $style == "flat"
71
+ $second-color: $base-color
72
+ background-color: $base-color
73
+ border: 0
74
+
75
+ @if $auto-states
76
+ @include sassy-pseudo-states($base-color, false, $style)
77
+
78
+ // Apply Text Styles
79
+ @if $text-style
80
+ @include sassy-button-text-style($first-color, $second-color, $text-color, $text-style)
81
+
82
+
83
+
@@ -1,41 +1,42 @@
1
- // Mixin that generates :hover state, will eventually add other psuedo states.
1
+ // Mixin that generates :hover and :active psuedo states.
2
+
3
+ @mixin sassy-pseudo-states($first-color, $second-color, $style)
4
+ @include sassy-button-hover($first-color, $second-color, $style)
5
+
6
+
7
+ @mixin sassy-button-hover($first-color, $second-color, $style)
8
+
9
+ @if $style == "matte"
10
+ &:hover
11
+ background-color: darken($second-color, 5%)
12
+ @include background(linear-gradient(color-stops(darken($first-color, 5%) 3%, darken($second-color, 5%) 75%)))
13
+ &:active
14
+ @include sassy-button-active-shadow($second-color)
15
+ @if $style == "shiny"
16
+ &:hover
17
+ background-color: $second-color
18
+ @include background(linear-gradient(color-stops(darken($first-color, 2%), $second-color 50%, darken($second-color, 8%))))
19
+ &:active
20
+ @include sassy-button-active-shadow($second-color)
21
+ @if $style == "glass"
22
+ &:hover
23
+ background-color: darken($second-color, 7%)
24
+ @include background(linear-gradient(color-stops(darken($first-color, 7%) 50%, darken($second-color, 7%) 51%)))
25
+ &:active
26
+ @include sassy-button-active-shadow($second-color)
27
+ @if $style == "simple"
28
+ &:hover
29
+ background-color: darken($second-color, 5%)
30
+ @include background(linear-gradient(color-stops(darken($first-color, 5%),darken($second-color, 5%))))
31
+ &:active
32
+ @include sassy-button-active-shadow($second-color)
33
+ @if $style == "flat"
34
+ &:hover
35
+ background-color: darken($first-color, 5%)
36
+ &:active
37
+ background-color: darken($first-color, 8%)
2
38
 
3
- @mixin sassy-pseudo-states($states, $first-color, $second-color, $highlight, $style)
4
- @if $states == "all"
5
- @include sassy-button-hover($first-color, $second-color, $highlight, $style)
6
39
 
7
40
 
8
- @mixin sassy-button-hover($first-color, $second-color, $highlight, $style)
9
41
 
10
- @if $style == "matte"
11
- &:hover
12
- @include sb-ie-hover($first-color)
13
- @include background(linear-gradient(color-stops($highlight, lighten($first-color, 5%) 3%, lighten($second-color, 5%) 75%)))
14
- @if $style == "shiny"
15
- &:hover
16
- @include sb-ie-hover($first-color)
17
- @include background(linear-gradient(color-stops($highlight, lighten($first-color, 4%) 3%, lighten($second-color, 8%) 60%, lighten($second-color, 4%))))
18
- @if $style == "glass"
19
- &:hover
20
- @include sb-ie-hover($first-color)
21
- @include background(linear-gradient(color-stops($highlight, lighten($first-color, 15%) 2%, lighten($first-color, 10%) 50%, lighten($first-color, 3%) 51%, lighten($second-color, 10%))))
22
- @if $style == "simple"
23
- &:hover
24
- @include sb-ie-hover($first-color)
25
- @include background(linear-gradient(color-stops(lighten($first-color, 5%),lighten($second-color, 5%))))
26
- @if $style == "flat"
27
- &:hover
28
- :background-color lighten($first-color, 5%)
29
42
 
30
- // To do add other pseudo states
31
-
32
-
33
- @mixin sb-ie-hover($color)
34
- @if $sb-ieSupport
35
- @if (lightness($color) > 75)
36
- $color: darken($color, 15%)
37
- :background-color $color
38
-
39
-
40
-
41
-
@@ -0,0 +1,8 @@
1
+ // Mixinins for shadows used in buttons
2
+ @mixin sassy-button-highlight-shadow($base-color)
3
+ @include box-shadow(lighten($base-color, 15%) 0 1px 0 inset)
4
+
5
+ @mixin sassy-button-active-shadow($second-color)
6
+ @include box-shadow(darken($second-color, 8%) 0 1px 2px inset)
7
+
8
+
@@ -1,13 +1,15 @@
1
1
  // Mixin for some optional styles on sassy buttons
2
2
 
3
3
  @mixin sassy-button-style($style, $base-color: $sb-base-color)
4
- @if $style == "push"
5
- @include box-shadow(darken($base-color, 5%), 0, 0.4em, 0px)
6
- :border-bottom solid 1px lighten($base-color, 3%)
7
- &:active
8
- :top .3em
9
- @include box-shadow(darken($base-color, 8%), 0, 0.2em, 0px)
10
- @if $style == "inset"
11
- @include box-shadow(darken($base-color, 8%) 0 0.2em 0.4em inset)
12
- :border solid 1px darken($base-color, 15%)
4
+ @if $style == "push"
5
+ @include box-shadow(darken($base-color, 12%) 0 0.4em 0px, lighten($base-color, 18%) 0 1px 0 inset)
6
+ border-bottom: solid 1px $base-color
7
+ &:active
8
+ top: .3em
9
+ @include box-shadow(darken($base-color, 8%) 0 0.2em 0px)
10
+ @if $style == "inset"
11
+ @include box-shadow(darken($base-color, 8%) 0 0.2em 0.4em inset)
12
+ border: solid 1px darken($base-color, 15%)
13
+ &:active
14
+ @include box-shadow(darken($base-color, 12%) 0 0.2em 0.4em inset)
13
15
 
@@ -1,24 +1,25 @@
1
1
  // Mixin that controls the text style
2
2
  @mixin sassy-button-text-style($base-color, $second-color, $text-color, $text-style: "inset")
3
- $text-lightness: lightness($text-color)
4
- $text-color-shift: 0
5
- $diff : lightness($base-color) - lightness($second-color)
6
-
7
- @if $diff > 40
8
- $text-color-shift: 30 + ($diff/10)
9
- @else if $diff > 18
10
- $text-color-shift: 20 + ($diff/10)
11
- @else
12
- $text-color-shift: 10 + ($diff/10)
13
-
14
- :color $text-color
15
- @if $text-style == "inset"
16
- @if $text-lightness < 50
17
- @include text-shadow(lighten($base-color, $text-color-shift) 0 1px 0)
18
- @else
19
- @include text-shadow(darken($base-color, $text-color-shift), 0 -1px 0)
20
- @if $text-style == "raised"
21
- @if $text-lightness < 50
22
- @include text-shadow(lighten($base-color, $text-color-shift), 0 -1px 0)
23
- @else
24
- @include text-shadow(darken($base-color, $text-color-shift), 0 1px 0)
3
+ $text-lightness: lightness($text-color)
4
+ $text-color-shift: 0
5
+ $diff : lightness($base-color) - lightness($second-color)
6
+
7
+ @if $diff > 40
8
+ $text-color-shift: 35 + ($diff/10)
9
+ @else if $diff > 18
10
+ $text-color-shift: 30 + ($diff/10)
11
+ @else
12
+ $text-color-shift: 25 + ($diff/10)
13
+
14
+ color: $text-color
15
+
16
+ @if $text-style == "inset"
17
+ @if $text-lightness < 50
18
+ @include text-shadow(lighten($second-color, ($text-color-shift/1.5)) 0 1px 0)
19
+ @else
20
+ @include text-shadow(darken($base-color, $text-color-shift) 0 -1px 0)
21
+ @if $text-style == "raised"
22
+ @if $text-lightness < 50
23
+ @include text-shadow(lighten($second-color, ($text-color-shift/1.5)) 0 -1px 0)
24
+ @else
25
+ @include text-shadow(darken($base-color, $text-color-shift) 0 1px 0)
@@ -1,27 +1,32 @@
1
1
  @import "sassy-buttons"
2
2
 
3
3
 
4
- // Sassy Button defaults
5
- // These are the base defaults for the buttons, if you are going to use similar buttons on an entire site,
6
- // overriding these can save you some time by calling the sassy button mixin with less arguments.
4
+ // Sassy Button defaults
5
+ // These are the base defaults for the buttons, if you are going to use similar buttons on an entire site,
6
+ // overriding these can save you some time by calling the sassy button mixin with less arguments.
7
7
 
8
- $sb-base-color: rgba(11,153,194,1) // Base color of button.
9
- $sb-second-color: false // Optional secondary color for gradient.
10
- $sb-border-radius: 10px // Border radius of button.
11
- $sb-border-width: 1px // Border width.
12
- $sb-padding: .5em 1.5em // Padding that gives button structure.
13
- $sb-font-size: 16px // Font size.
14
- $sb-line-height: 1.2em // Line Height.
15
- $sb-text-color: #fff // Button font color.
16
- $sb-text-style: "inset" // Style of button text, can be "inset" or "raised" or false.
17
- $sb-gradient-style: "matte" // Gradient style of button, can be "matte", "shiny", or "glass".
18
- $sb-hover: true // Automatically generate psuedo :hover state styles.
19
- $sb-ieSupport: false // TODO - Better IE support
8
+ $sb-base-color: rgba(11,153,194,1) // Base color of button.
9
+ $sb-second-color: false // Optional secondary color for gradient.
10
+ $sb-border-radius: 10px // Border radius of button.
11
+ $sb-padding: .3em 1.5em // Padding that gives button structure.
12
+ $sb-font-size: 16px // Font size.
13
+ $sb-text-color: #fff // Button font color.
14
+ $sb-text-style: "inset" // Style of button text, can be "inset" or "raised" or false.
15
+ $sb-gradient-style: "simple" // Gradient style of button, can be "flat", "glass", "matte", "shiny", or "simple".
16
+ $sb-pseudo-states: true // Automatically generate pseudo state styles.
17
+
18
+ // Mixin that gets included when calling the sassy-button-structure if you need any
19
+ // styles applied to all your sassy buttons, add it here.
20
20
 
21
- // Mixing that gets included when calling the sassy-button-structure if you need any
22
- // styles applied to all your sassy buttons, you can add them here.
23
21
  @mixin sassy-button-default-structure
24
- :display inline-block
25
- :width auto
26
- :height auto
27
- :cursor pointer
22
+ display: inline-block
23
+ cursor: pointer
24
+ text-decoration: none
25
+ line-height: 1.5
26
+
27
+
28
+ // * Mixin reference
29
+ // * -----------------------------------------
30
+ // * @include sassy-button(gradient-style, border-radius, font-size, first-color, second-color, text-color, text-style, auto-states);
31
+ // * @include sassy-button-structure(-border-radius, font-size, padding);
32
+ // * @include sassy-button-gradient(gradient-style, first-color, second-color, text-color, text-style, auto-states);
metadata CHANGED
@@ -1,72 +1,67 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: sassy-buttons
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.6
4
5
  prerelease:
5
- version: 0.0.5
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Jared Hardy
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-06-03 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2011-06-03 00:00:00.000000000 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
16
  name: compass
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &70361258691380 !ruby/object:Gem::Requirement
19
18
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0.11"
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0.11'
24
23
  type: :runtime
25
- version_requirements: *id001
24
+ prerelease: false
25
+ version_requirements: *70361258691380
26
26
  description: Sassy css3 buttons using compass
27
27
  email: jared@jaredhardy.com
28
28
  executables: []
29
-
30
29
  extensions: []
31
-
32
30
  extra_rdoc_files: []
33
-
34
- files:
31
+ files:
35
32
  - README.mkdn
36
33
  - lib/sassy-buttons.rb
37
34
  - stylesheets/_sassy-buttons.sass
38
- - stylesheets/sassy-buttons/_sassy-button-colors.sass
35
+ - stylesheets/sassy-buttons/_sassy-button-gradients.sass
39
36
  - stylesheets/sassy-buttons/_sassy-button-pseudo-states.sass
37
+ - stylesheets/sassy-buttons/_sassy-button-shadows.sass
40
38
  - stylesheets/sassy-buttons/_sassy-button-styles.sass
41
39
  - stylesheets/sassy-buttons/_sassy-button-text.sass
42
40
  - templates/project/_sassybuttons.sass
43
41
  - templates/project/manifest.rb
42
+ has_rdoc: true
44
43
  homepage: http://www.jaredhardy.com
45
44
  licenses: []
46
-
47
45
  post_install_message:
48
46
  rdoc_options: []
49
-
50
- require_paths:
47
+ require_paths:
51
48
  - lib
52
- required_ruby_version: !ruby/object:Gem::Requirement
49
+ required_ruby_version: !ruby/object:Gem::Requirement
53
50
  none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: "0"
58
- required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
56
  none: false
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: "0"
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
64
61
  requirements: []
65
-
66
62
  rubyforge_project:
67
- rubygems_version: 1.7.2
63
+ rubygems_version: 1.6.2
68
64
  signing_key:
69
65
  specification_version: 3
70
66
  summary: css only buttons extension for compass
71
67
  test_files: []
72
-
@@ -1,78 +0,0 @@
1
- // Mixin that does all the gradient magic
2
- @import "sassy-button-text"
3
-
4
- @mixin sassy-button-colors($style: "matte", $base-color: $sb-base-color, $second-color: "false", $auto-states: true, $text-color: $sb-text-color, $text-style: $sb-text-stlye)
5
- $first-color: $base-color
6
- $lightness : lightness($base-color)
7
- $brightnessDivsor : 1
8
- @if $lightness > 75
9
- $brightnessDivsor : 2
10
-
11
- background-color: $base-color
12
-
13
-
14
- @if $style == "matte"
15
- $highlight: lighten($base-color, 30%)
16
- $first-color: $base-color
17
-
18
- @if $second-color == false
19
- $first-color: lighten($base-color,15%)
20
- $second-color: $base-color
21
-
22
- @include background(linear-gradient(color-stops($highlight, $first-color 3%, $second-color 70%)))
23
-
24
- :border-color $second-color
25
- @if $auto-states
26
- @include sassy-pseudo-states("all", $first-color, $second-color, $highlight, $style)
27
-
28
-
29
- @if $style == "shiny"
30
- $highlight : lighten($base-color, 55%)
31
- $first-color: lighten($base-color, 25% / $brightnessDivsor)
32
-
33
- @if $second-color == false
34
- $second-color: darken($base-color, 10%)
35
-
36
- @include background(linear-gradient(color-stops($highlight,$first-color 3%, $base-color 50%, $second-color)))
37
-
38
- :border-color $second-color
39
-
40
- @if $auto-states
41
- @include sassy-pseudo-states("all", $first-color, $second-color, $highlight, $style)
42
-
43
- @if $style == "glass"
44
- $highlight : lighten($base-color, 55%)
45
- $shine: lighten($base-color,10%)
46
- $first-color: lighten($base-color, 8% / $brightnessDivsor)
47
-
48
- @if $second-color == false
49
- $second-color: darken($base-color, 10%)
50
-
51
- @include background(linear-gradient(color-stops($highlight, $shine 2%, $first-color 50%, $base-color 51%, $second-color)))
52
- :border-color $second-color
53
-
54
- @if $auto-states
55
- @include sassy-pseudo-states("all", $first-color, $second-color, $highlight, $style)
56
-
57
- @if $style == "simple"
58
- @if $second-color == false
59
- $second-color: darken($base-color, 20%)
60
-
61
- @include background(linear-gradient(color-stops($base-color, $second-color)))
62
- :border-color $second-color
63
-
64
- @if $auto-states
65
- @include sassy-pseudo-states("all", $base-color, $second-color, false, $style)
66
-
67
- @if $style == "flat"
68
- $second-color: $base-color
69
- :background-color $base-color
70
- :border 0
71
-
72
- @if $auto-states
73
- @include sassy-pseudo-states("all", $base-color, false, false, $style)
74
-
75
- // Apply Text Styles
76
- @if $text-style
77
- @include sassy-button-text-style($first-color, $second-color, $text-color, $text-style)
78
-