golden-label 0.1.0
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.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +67 -0
- data/Rakefile +1 -0
- data/app/assets/stylesheets/golden/label.css.sass +23 -0
- data/app/assets/stylesheets/golden/label/base.sass +22 -0
- data/app/assets/stylesheets/golden/label/bootstrap.sass +18 -0
- data/app/assets/stylesheets/golden/label/effect.sass +49 -0
- data/app/assets/stylesheets/golden/label/mixins.sass +24 -0
- data/app/assets/stylesheets/golden/label/position.sass +56 -0
- data/app/assets/stylesheets/golden/label/variables.sass +4 -0
- data/golden-label.gemspec +26 -0
- data/lib/golden/label.rb +7 -0
- data/lib/golden/label/engine.rb +6 -0
- data/lib/golden/label/version.rb +6 -0
- metadata +117 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 64e6302b465b1a15a7f4d430e49540650786ba4a
|
4
|
+
data.tar.gz: ed75492e76876b3591b3fb0d0ba1cf4a5109d027
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e07ec91d6093467201ccb88e41b352e985dafb67a78ee0506aaa4f6deb4965bf39ecc6bf3f811ae9616b74d5d67d67f8b4edcd7c46aafdeb40e97c12525de2d9
|
7
|
+
data.tar.gz: 612b96edfcf6a214b9194e149d73d1369efe7f6a449e5f8c6c9819ac4e84a769b1ccfe275777535c324b6eb1827cd65849cecd2810545c92f8b5954cf1023255
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Tse-Ching Ho
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
# Golden Label
|
2
|
+
|
3
|
+
[label.css](https://github.com/usablica/label.css) is a stylesheet providing an easy way to label html elements.
|
4
|
+
|
5
|
+
The `golden-label` gem integrates `label.css` with Rails asset pipeline for easy of use.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Include `golden-label` in Gemefile
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'golden-label'
|
13
|
+
```
|
14
|
+
|
15
|
+
Then run `bundle install`
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
Add to your `app/assets/stylesheets/application.css`.
|
20
|
+
|
21
|
+
```css
|
22
|
+
*= require golden/label
|
23
|
+
```
|
24
|
+
|
25
|
+
Add html element with `label` class and `data-label` attribute.
|
26
|
+
|
27
|
+
```html
|
28
|
+
<figure class="label" data-label="HTML5 & CSS3">
|
29
|
+
<img src="images/html5css3.png" alt="HTML5 & CSS3">
|
30
|
+
</figure>
|
31
|
+
```
|
32
|
+
|
33
|
+
Adjust positon of label by adding class combination.
|
34
|
+
|
35
|
+
* `inside` can go with `top`, `middle`, `bottom`, `left` and `right`
|
36
|
+
* `outside` can go with `top` and `bottom`
|
37
|
+
|
38
|
+
Add hover effects by adding `fade` or `float` class.
|
39
|
+
|
40
|
+
```html
|
41
|
+
<figure class="label inside bottom left float" data-label="HTML5 & CSS3">
|
42
|
+
<img src="images/html5css3.png" alt="HTML5 & CSS3">
|
43
|
+
</figure>
|
44
|
+
```
|
45
|
+
|
46
|
+
## Customization
|
47
|
+
|
48
|
+
Add to your `app/assets/stylesheets/golden/label/variables.sass`.
|
49
|
+
|
50
|
+
```sass
|
51
|
+
$label-background-color: rgba(242, 190, 69, 0.8)
|
52
|
+
$label-font-family: Helvetica
|
53
|
+
$label-font-size: 2em
|
54
|
+
$label-font-weight: bold
|
55
|
+
```
|
56
|
+
|
57
|
+
## Contributing
|
58
|
+
|
59
|
+
1. Fork it
|
60
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
61
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
62
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
63
|
+
5. Create new Pull Request
|
64
|
+
|
65
|
+
## License
|
66
|
+
|
67
|
+
use MIT license.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
/*---------------------------------------
|
2
|
+
* Label.css
|
3
|
+
*
|
4
|
+
* Developed By Hosein Emrani:
|
5
|
+
*
|
6
|
+
* | Twitter: (@hoseiin)
|
7
|
+
* | Facebook: (fb.com/hosein.emrani)
|
8
|
+
* | Mail: hoseiin[at]outlook[dot]com
|
9
|
+
*
|
10
|
+
* Github: http://github.com/usablica/label.css
|
11
|
+
*
|
12
|
+
* With love in usablica, Tehran.
|
13
|
+
*---------------------------------------
|
14
|
+
* Rewrited by Tse-Ching Ho
|
15
|
+
*----------------------------------------
|
16
|
+
*/
|
17
|
+
|
18
|
+
@import label/variables
|
19
|
+
@import label/mixins
|
20
|
+
@import label/base
|
21
|
+
@import label/position
|
22
|
+
@import label/effect
|
23
|
+
@import label/bootstrap
|
@@ -0,0 +1,22 @@
|
|
1
|
+
/* Basic CSS for the label */
|
2
|
+
|
3
|
+
.label[data-label]
|
4
|
+
position: relative
|
5
|
+
font-family: $label-font-family
|
6
|
+
margin: auto
|
7
|
+
display: inline-block
|
8
|
+
width: auto
|
9
|
+
overflow: hidden
|
10
|
+
&:after, &:before
|
11
|
+
position: absolute
|
12
|
+
height: auto
|
13
|
+
width: 98%
|
14
|
+
display: block
|
15
|
+
padding: 1%
|
16
|
+
background: $label-background-color
|
17
|
+
font-family: $label-font-family
|
18
|
+
font-size: $label-font-size
|
19
|
+
font-weight: $label-font-weight
|
20
|
+
content: attr(data-label)
|
21
|
+
span[data-label]
|
22
|
+
content: attr(data-label)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/* Bootstrap Hack!
|
2
|
+
* revert to initial style for ".label" and ".fade" class.
|
3
|
+
*/
|
4
|
+
|
5
|
+
.label[data-label]
|
6
|
+
padding: initial !important
|
7
|
+
font-size: initial !important
|
8
|
+
font-weight: initial !important
|
9
|
+
line-height: initial !important
|
10
|
+
color: initial !important
|
11
|
+
text-shadow: initial !important
|
12
|
+
white-space: initial !important
|
13
|
+
vertical-align: initial !important
|
14
|
+
background-color: initial !important
|
15
|
+
border-radius: initial !important
|
16
|
+
&.fade
|
17
|
+
opacity: initial !important
|
18
|
+
transition: initial !important
|
@@ -0,0 +1,49 @@
|
|
1
|
+
/* fade effect */
|
2
|
+
|
3
|
+
.label[data-label]
|
4
|
+
&.fade
|
5
|
+
&:after, &:before
|
6
|
+
@include label-transition
|
7
|
+
@include label-visibility(false)
|
8
|
+
&:hover
|
9
|
+
&:after, &:before
|
10
|
+
@include label-visibility(true)
|
11
|
+
|
12
|
+
|
13
|
+
/* float effect */
|
14
|
+
|
15
|
+
.label[data-label]
|
16
|
+
&.float
|
17
|
+
&:after, &:before
|
18
|
+
@include label-transition
|
19
|
+
@include label-visibility(false)
|
20
|
+
&:hover
|
21
|
+
&:after, &:before
|
22
|
+
@include label-visibility(true)
|
23
|
+
&.inside
|
24
|
+
&.top.float
|
25
|
+
&:before
|
26
|
+
top: -15px
|
27
|
+
&:hover:before
|
28
|
+
top: 0
|
29
|
+
&.bottom.float
|
30
|
+
&:after
|
31
|
+
bottom: -5px
|
32
|
+
&:hover:after
|
33
|
+
bottom: 1%
|
34
|
+
&.middle.float
|
35
|
+
&:after
|
36
|
+
margin-top: 20px
|
37
|
+
&:hover:after
|
38
|
+
margin-top: 0px
|
39
|
+
&.outside
|
40
|
+
&.top.float
|
41
|
+
&:before
|
42
|
+
top: 10px
|
43
|
+
&:hover:before
|
44
|
+
top: 0px
|
45
|
+
&.bottom.float
|
46
|
+
&:after
|
47
|
+
top: -10px
|
48
|
+
&:hover:after
|
49
|
+
top: 0px
|
@@ -0,0 +1,24 @@
|
|
1
|
+
@mixin label-float($place)
|
2
|
+
@if $place == left
|
3
|
+
float: left
|
4
|
+
width: auto
|
5
|
+
left: 0px
|
6
|
+
@else
|
7
|
+
float: right
|
8
|
+
width: auto
|
9
|
+
right: 0px
|
10
|
+
|
11
|
+
@mixin label-transition($delay: 0.25s)
|
12
|
+
transition: all $delay ease
|
13
|
+
-webkit-transition: all $delay ease
|
14
|
+
-moz-transition: all $delay ease
|
15
|
+
-ms-transition: all $delay ease
|
16
|
+
-o-transition: all $delay ease
|
17
|
+
|
18
|
+
@mixin label-visibility($visible)
|
19
|
+
@if $visible == true
|
20
|
+
opacity: 1
|
21
|
+
visibility: visible
|
22
|
+
@else
|
23
|
+
opacity: 0
|
24
|
+
visibility: hidden
|
@@ -0,0 +1,56 @@
|
|
1
|
+
/* Inside Positions */
|
2
|
+
|
3
|
+
.label[data-label]
|
4
|
+
&.inside
|
5
|
+
&.top
|
6
|
+
&:before
|
7
|
+
top: 0px
|
8
|
+
&:after,
|
9
|
+
display: none
|
10
|
+
&.middle
|
11
|
+
&:before
|
12
|
+
display: none
|
13
|
+
&:after
|
14
|
+
top: 45%
|
15
|
+
&.bottom
|
16
|
+
&:before
|
17
|
+
display: none
|
18
|
+
&:after
|
19
|
+
bottom: 1%
|
20
|
+
&.left
|
21
|
+
&:after, &:before
|
22
|
+
@include label-float(left)
|
23
|
+
&.right
|
24
|
+
&:after, &:before
|
25
|
+
@include label-float(right)
|
26
|
+
|
27
|
+
|
28
|
+
/* Outside Positions */
|
29
|
+
|
30
|
+
.label[data-label]
|
31
|
+
&.outside
|
32
|
+
overflow: initial
|
33
|
+
&:after, &:before
|
34
|
+
position: relative
|
35
|
+
background: none
|
36
|
+
&:after
|
37
|
+
margin-bottom: -5%
|
38
|
+
&:before
|
39
|
+
margin-top: -5%
|
40
|
+
&.top
|
41
|
+
&:after,
|
42
|
+
display: none
|
43
|
+
&.bottom
|
44
|
+
&:before
|
45
|
+
display: none
|
46
|
+
&:after
|
47
|
+
bottom: 1%
|
48
|
+
|
49
|
+
|
50
|
+
/* RTL Support */
|
51
|
+
|
52
|
+
.label[data-label]
|
53
|
+
&.rtl
|
54
|
+
&:after, &:before
|
55
|
+
text-align: right
|
56
|
+
direction: rtl
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'golden/label/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'golden-label'
|
8
|
+
spec.version = Golden::Label::VERSION
|
9
|
+
spec.authors = ['Tse-Ching Ho']
|
10
|
+
spec.email = ['tsechingho@gmail.com']
|
11
|
+
spec.description = %q{label.css is a stylesheet providing an easy way to label html elements. This gem integrates label.css with Rails asset pipeline for easy of use.}
|
12
|
+
spec.summary = %q{Integrate label.css with Rails asset pipeline}
|
13
|
+
spec.homepage = 'https://github.com/goldenio/golden-label'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_dependency 'railties', '>= 3.0'
|
22
|
+
spec.add_dependency 'sass-rails', '>= 3.2'
|
23
|
+
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
25
|
+
spec.add_development_dependency 'rake'
|
26
|
+
end
|
data/lib/golden/label.rb
ADDED
metadata
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: golden-label
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tse-Ching Ho
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-05-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: railties
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sass-rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.3'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: label.css is a stylesheet providing an easy way to label html elements.
|
70
|
+
This gem integrates label.css with Rails asset pipeline for easy of use.
|
71
|
+
email:
|
72
|
+
- tsechingho@gmail.com
|
73
|
+
executables: []
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- .gitignore
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- app/assets/stylesheets/golden/label.css.sass
|
83
|
+
- app/assets/stylesheets/golden/label/base.sass
|
84
|
+
- app/assets/stylesheets/golden/label/bootstrap.sass
|
85
|
+
- app/assets/stylesheets/golden/label/effect.sass
|
86
|
+
- app/assets/stylesheets/golden/label/mixins.sass
|
87
|
+
- app/assets/stylesheets/golden/label/position.sass
|
88
|
+
- app/assets/stylesheets/golden/label/variables.sass
|
89
|
+
- golden-label.gemspec
|
90
|
+
- lib/golden/label.rb
|
91
|
+
- lib/golden/label/engine.rb
|
92
|
+
- lib/golden/label/version.rb
|
93
|
+
homepage: https://github.com/goldenio/golden-label
|
94
|
+
licenses:
|
95
|
+
- MIT
|
96
|
+
metadata: {}
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - '>='
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 2.0.3
|
114
|
+
signing_key:
|
115
|
+
specification_version: 4
|
116
|
+
summary: Integrate label.css with Rails asset pipeline
|
117
|
+
test_files: []
|