uberbutton 0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.mkdn ADDED
@@ -0,0 +1,45 @@
1
+ Uberbutton - Compass Plugin
2
+ ================================
3
+
4
+ A class and a mixin to generate nifty buttons.
5
+
6
+
7
+ Installation
8
+ ==================================
9
+
10
+ gem install uberbutton
11
+
12
+ Add the following line to config/compass.rb
13
+ require 'uberbutton'
14
+
15
+ Install the framework
16
+ compass install uberbutton
17
+
18
+ Usage
19
+ ==================================
20
+
21
+ The class "uberbutton" includes common base styles for each button.
22
+ The mixin "uberbutton" lets you create classes for different styled buttons.
23
+
24
+ Use "uberbutton" in conjunction with a style class you create.
25
+ (This isolates the common code and is for DRY).
26
+
27
+ Example:
28
+
29
+ Create the style class in scss
30
+ .main-cta {
31
+ @include uberbutton(start-color, end-color, "path_to_background_pattern");
32
+ }
33
+
34
+ Use both style class and uberbutton to construct button.
35
+ <a class="uberbutton main-cta">
36
+ Hello world.
37
+ </a>
38
+
39
+
40
+
41
+
42
+ Author
43
+ ====================
44
+
45
+ [Cemre Gungor](http://cem,re/) started this project while drinking Four Loko.
data/lib/uberbutton.rb ADDED
@@ -0,0 +1,2 @@
1
+ require 'compass'
2
+ Compass::Frameworks.register("uberbutton", :path => "#{File.dirname(__FILE__)}/..")
@@ -0,0 +1 @@
1
+ @import "uberbutton/_uberbutton.scss";
@@ -0,0 +1,124 @@
1
+
2
+ /*
3
+ Uberbutton
4
+ The one button you'll ever need.
5
+
6
+ Cemre Gungor http://cem.re
7
+
8
+ */
9
+
10
+ @import "compass/css3";
11
+
12
+ $uberbutton-base-class: "uberbutton" !default;
13
+ $uberbutton-csspie-location: "/css3pie/PIE.htc" !default;
14
+
15
+ // mixin used to create different colored buttons.
16
+ @mixin uberbutton($color1, $color2, $pattern: "") {
17
+ $text-color: white;
18
+ $shadow-color: rgba(0, 0, 0, 0.5);
19
+ $shadow-position: -1px;
20
+
21
+ @if lightness(mix($color1, $color2, 50%)) > 50% {
22
+ $text-color: #333333;
23
+ $text-color: rgba(0, 0, 0, 0.7);
24
+ $shadow-color: rgba(255, 255, 255, 0.7);
25
+ $shadow-position: 1px;
26
+ }
27
+
28
+ @include uberbutton-base($color1, $color2, $text-color, $shadow-color, $shadow-position, $pattern); }
29
+
30
+
31
+ .#{$uberbutton-base-class} {
32
+ behavior: url($uberbutton-csspie-location);
33
+ @include transition(all, 0.1s, ease-in-out);
34
+
35
+
36
+ // border
37
+ @include border-radius(4px);
38
+ -webkit-background-clip: padding-box;
39
+
40
+ // type
41
+ line-height: 150%;
42
+ font-weight: 500;
43
+ text-decoration: none;
44
+
45
+ // box structure
46
+ display: inline-block;
47
+ height: auto;
48
+ padding: 4px 10px;
49
+ cursor: pointer;
50
+ @include box-shadow(rgba(255, 255, 255, 0.5) 0px 1px 0px 0px inset, rgba(0, 0, 0, 0.2) 0px 1px 2px 0px);
51
+
52
+ &:hover {
53
+ text-decoration: none;
54
+ }
55
+
56
+ &:link, &:visited {
57
+ margin-right: 10px;
58
+ line-height: 150%;
59
+ }
60
+
61
+ &:active {
62
+ @include box-shadow(rgba(0, 0, 0, 0.1) 0px 1px 5px 0px);
63
+ @include translate(0, 2px);
64
+ }
65
+
66
+ img {
67
+ position: relative;
68
+ top: 3px;
69
+ margin-right: 5px;
70
+ }
71
+ }
72
+
73
+ @mixin uberbutton-base($color1, $color2, $text-color, $shadow-color, $shadow-position, $pattern: "") {
74
+ $lighten_amount: 4%;
75
+ background-color: mix($color1, $color2, 50%); //fallback color
76
+ -pie-background: linear-gradient($color1, $color2);
77
+
78
+ // background
79
+ @if $pattern != "" {
80
+ @include linear-gradient(color_stops($color1, $color2), top, image-url($pattern));
81
+ }
82
+ @else {
83
+ @include linear-gradient(color_stops($color1, $color2), top);
84
+ }
85
+
86
+ // border
87
+ border: 1px solid darken($color2, 12%);
88
+
89
+ // text
90
+ @include text-shadow($shadow-color, 0, $shadow-position, 0);
91
+ color: $text-color;
92
+
93
+ &:link, &:visited {
94
+ color: $text-color;
95
+ border: 1px solid darken($color2, 20%);
96
+ }
97
+
98
+ &:hover {
99
+ background-color: mix(lighten($color1, $lighten_amount), lighten($color2, $lighten_amount), 50%);
100
+ -pie-background: linear-gradient(lighten($color1, $lighten_amount), lighten($color2, $lighten_amount));
101
+
102
+ @if $pattern != "" {
103
+ @include linear-gradient(color_stops(lighten($color1, $lighten_amount), lighten($color2, $lighten_amount)), top, image-url($pattern));
104
+ }
105
+ @else {
106
+ @include linear-gradient(color_stops(lighten($color1, $lighten_amount), lighten($color2, $lighten_amount)), top);
107
+ }
108
+
109
+ color: $text-color;
110
+ border: 1px solid darken($color2, 20%);
111
+ }
112
+
113
+ &:active {
114
+ background-color: mix(darken($color1, $lighten_amount), darken($color2, $lighten_amount), 50%);
115
+ -pie-background: linear-gradient(darken($color1, $lighten_amount), darken($color2, $lighten_amount));
116
+ @include linear-gradient(color_stops($color2, $color1), top);
117
+ @include text-shadow($shadow-color, 0, $shadow-position * -1, 0);
118
+ color: $text-color;
119
+ }
120
+
121
+ &:focus {
122
+ @include box-shadow(opacify($color1, 0.5) 0 0 10px 0);
123
+ }
124
+ }
@@ -0,0 +1,26 @@
1
+ // This is where you put the contents of the main stylesheet for the user's project.
2
+ // It should import your sass stylesheets and demonstrate how to use them.
3
+
4
+ @import "compass/reset";
5
+ @import "uberbutton/uberbutton";
6
+
7
+ .button1 {
8
+ @include uberbutton(#2386b9, #154b7f)
9
+ }
10
+
11
+ .button2 {
12
+ @include uberbutton(#FFE497, #F2BF2F)
13
+ }
14
+
15
+ .button3 {
16
+ @include uberbutton(#C8E66E, #A5D207)
17
+ }
18
+
19
+ .button4 {
20
+ @include uberbutton(#CC0400, #890001)
21
+ }
22
+
23
+ .button5 {
24
+ @include uberbutton(#99CC00, #669900);
25
+ font-weight: bold;
26
+ }
@@ -0,0 +1,44 @@
1
+ description "The one button you will ever need."
2
+
3
+ stylesheet 'button.scss'
4
+ image 'noise.png'
5
+
6
+ help %Q{
7
+ The class "uberbutton" includes common base styles for each button.
8
+ The mixin "uberbutton" lets you create classes for different styled buttons.
9
+
10
+ Use "uberbutton" in conjunction with a style class you create.
11
+ (This is to abstract the common code and to save loading times).
12
+
13
+ Example:
14
+
15
+ Create the style class in scss
16
+ .main-cta {
17
+ @include uberbutton(start-color, end-color, "path_to_background_pattern");
18
+ }
19
+
20
+ Use both style class and uberbutton to construct button.
21
+ <a class="uberbutton main-cta">
22
+ Hello world.
23
+ </a>
24
+ }
25
+
26
+ welcome_message %Q{
27
+ The class "uberbutton" includes common base styles for each button.
28
+ The mixin "uberbutton" lets you create classes for different styled buttons.
29
+
30
+ Use "uberbutton" in conjunction with a style class you create.
31
+ (This is to abstract the common code and to save loading times).
32
+
33
+ Example:
34
+
35
+ Create the style class in scss
36
+ .main-cta {
37
+ @include uberbutton(start-color, end-color, "path_to_background_pattern");
38
+ }
39
+
40
+ Use both style class and uberbutton to construct button.
41
+ <a class="uberbutton main-cta">
42
+ Hello world.
43
+ </a>
44
+ }
Binary file
@@ -0,0 +1,32 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{uberbutton}
5
+ s.version = "0.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5")
8
+ s.authors = ["Cemre Gungor"]
9
+ s.date = %q{2011-05-05}
10
+ s.description = %q{a class and mixin for nifty buttons}
11
+ s.summary = %q{a class and mixin for nifty buttons}
12
+ s.email = "cg@iki.fi"
13
+
14
+ s.has_rdoc = false
15
+ s.files = [
16
+ "uberbutton.gemspec",
17
+ "README.mkdn",
18
+ "lib/uberbutton.rb",
19
+ "stylesheets/uberbutton.scss",
20
+ "stylesheets/uberbutton/_uberbutton.scss",
21
+ "templates/project/button.scss",
22
+ "templates/project/noise.png",
23
+ "templates/project/manifest.rb"
24
+ ]
25
+
26
+ s.homepage = %q{http://github.com/cemregr/uberubtton}
27
+ s.require_paths = ["lib"]
28
+ s.rubyforge_project = %q{uberbutton}
29
+ s.rubygems_version = %q{1.3.6}
30
+
31
+ s.add_dependency(%q<compass>, [">= 0.10.0"])
32
+ end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: uberbutton
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ version: "0.1"
9
+ platform: ruby
10
+ authors:
11
+ - Cemre Gungor
12
+ autorequire:
13
+ bindir: bin
14
+ cert_chain: []
15
+
16
+ date: 2011-05-05 00:00:00 -04:00
17
+ default_executable:
18
+ dependencies:
19
+ - !ruby/object:Gem::Dependency
20
+ name: compass
21
+ prerelease: false
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 10
30
+ - 0
31
+ version: 0.10.0
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ description: a class and mixin for nifty buttons
35
+ email: cg@iki.fi
36
+ executables: []
37
+
38
+ extensions: []
39
+
40
+ extra_rdoc_files: []
41
+
42
+ files:
43
+ - uberbutton.gemspec
44
+ - README.mkdn
45
+ - lib/uberbutton.rb
46
+ - stylesheets/uberbutton.scss
47
+ - stylesheets/uberbutton/_uberbutton.scss
48
+ - templates/project/button.scss
49
+ - templates/project/noise.png
50
+ - templates/project/manifest.rb
51
+ has_rdoc: true
52
+ homepage: http://github.com/cemregr/uberubtton
53
+ licenses: []
54
+
55
+ post_install_message:
56
+ rdoc_options: []
57
+
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ segments:
66
+ - 0
67
+ version: "0"
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ none: false
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ segments:
74
+ - 1
75
+ - 3
76
+ - 5
77
+ version: 1.3.5
78
+ requirements: []
79
+
80
+ rubyforge_project: uberbutton
81
+ rubygems_version: 1.3.7
82
+ signing_key:
83
+ specification_version: 3
84
+ summary: a class and mixin for nifty buttons
85
+ test_files: []
86
+