letterform-shades 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b82aac9997cedecc4d8abb77271b6348495affce
4
+ data.tar.gz: a6673d3baa70618a831f7bcedfcfb5fe8cc89540
5
+ SHA512:
6
+ metadata.gz: dbfadfc32c0581e9d827133fccfb05e4a8e900578659362efcae4466efb2ab2046720349a491af9f109534762f9b2faaf92c134683765bb2b353c6e6736c2016
7
+ data.tar.gz: 8ccce47565f42df6416333dc300ec59e9618f23d827ca6721624d47796ea6ff1ab28b832f49bcec8c17b6f519d80ae9f4b292d8a3cdc435b72ca74e5989f796f
@@ -0,0 +1,11 @@
1
+ if (defined? Compass)
2
+ Compass::Frameworks.register(
3
+ "toolkit",
4
+ :path => "#{File.dirname(__FILE__)}/.."
5
+ )
6
+ end
7
+
8
+ module LetterformShades
9
+ VERSION = "0.1.0"
10
+ DATE = "2014-05-06"
11
+ end
@@ -0,0 +1,5 @@
1
+ @import "letterform-shades/close-shade";
2
+ @import "letterform-shades/offset-shade";
3
+ @import "letterform-shades/printers-shade";
4
+ @import "letterform-shades/sandwich-shade";
5
+ @import "letterform-shades/reverse-shade";
@@ -0,0 +1,58 @@
1
+ //////////////////////////////
2
+ // Close-Shade Mixin, inspired by http://practice.typekit.com/lesson/using-shades/
3
+ // - $vertical: The color for the vertical shade (consider a lowercase `r`)
4
+ // - $horizontal: The color for the horizontal shade (consider the lowercase `r`)
5
+ // - $from: Direction shadow comes from. Options are `top right`, `top left`, `bottom right`, `bottom left`
6
+ // - $distance: The distance you want the shadow to extend. Must be a positive integer
7
+ // - $size: The size you want each slice.
8
+ //////////////////////////////
9
+ @mixin close-shade($vertical, $horizontal, $from: 'top right', $distance: 10, $size: 0.005em) {
10
+ $holder: ();
11
+
12
+ $vbs1: 0;
13
+ $vbs2: $size;
14
+ $vs1: $size * -1;
15
+ $vs2: 0;
16
+
17
+ @if type-of($from == 'list') {
18
+ $from: '#{$from}';
19
+ }
20
+
21
+ @for $i from 0 to $distance {
22
+ $offset: $size * $i;
23
+ $value-bottom: ();
24
+ $value: ();
25
+
26
+ @if (str-index($from, 'right')) {
27
+ $value-bottom: $vbs1 - $offset;
28
+ $value: $vs1 - $offset;
29
+ }
30
+ @else if (str-index($from, 'left')) {
31
+ $value-bottom: $vbs1 + $offset;
32
+ $value: -1 * $vs1 + $offset;
33
+ }
34
+ @else {
35
+ $value-bottom: 0;
36
+ $value: 0;
37
+ }
38
+
39
+ @if (str-index($from, 'top')) {
40
+ $value-bottom: join($value-bottom, ($vbs2 + $offset));
41
+ $value: join($value, ($vs2 + $offset));
42
+ }
43
+ @else if (str-index($from, 'bottom')) {
44
+ $value-bottom: join($value-bottom, (-1 * $vbs2 - $offset));
45
+ $value: join($value, (-1 * $vs2 - $offset));
46
+ }
47
+ @else {
48
+ $value-bottom: join($value-bottom, 0);
49
+ $value: join($value, 0);
50
+ }
51
+
52
+ $value-bottom: join($value-bottom, $horizontal);
53
+ $value: join($value, $vertical);
54
+ $holder: append($holder, $value-bottom, comma);
55
+ $holder: append($holder, $value, comma);
56
+ }
57
+ text-shadow: $holder;
58
+ }
@@ -0,0 +1,55 @@
1
+ //////////////////////////////
2
+ // Offset-Shade Mixin, inspired by http://practice.typekit.com/lesson/using-shades/
3
+ // - $background: The color of the background the text is on
4
+ // - $shade: The color of the shadow
5
+ // - $from: Direction shadow comes from. Options are `top right`, `top left`, `bottom right`, `bottom left`
6
+ // - $offset: The distance you want the shade to be offset
7
+ // - $size: The size you want the shade to be.
8
+ //////////////////////////////
9
+ @mixin offset-shade($background, $shade, $from: 'top right', $offset: .010em, $size: .030em) {
10
+
11
+ $size: $offset + $size;
12
+
13
+ $offsetShadow: '';
14
+ $shadeShadow: '';
15
+
16
+ @if type-of($from == 'list') {
17
+ $from: '#{$from}';
18
+ }
19
+
20
+ //////////////////////////////
21
+ // Left/Right
22
+ //////////////////////////////
23
+ @if str-index($from, 'right') {
24
+ $offsetShadow: $offset * -1;
25
+ $shadeShadow: $size * -1;
26
+ }
27
+ @else if str-index($from, 'left') {
28
+ $offsetShadow: $offset;
29
+ $shadeShadow: $size;
30
+ }
31
+ @else {
32
+ $offsetShadow: 0;
33
+ $shadeShadow: 0;
34
+ }
35
+
36
+ //////////////////////////////
37
+ // Top/Bottom
38
+ //////////////////////////////
39
+ @if str-index($from, 'top') {
40
+ $offsetShadow: append($offsetShadow, $offset, space);
41
+ $shadeShadow: append($shadeShadow, $size, space);
42
+ }
43
+ @else if str-index($from, 'bottom') {
44
+ $offsetShadow: append($offsetShadow, $offset * -1, space);
45
+ $shadeShadow: append($shadeShadow, $size * -1, space);
46
+ }
47
+
48
+ //////////////////////////////
49
+ // Colors and Shadow
50
+ //////////////////////////////
51
+ $offsetShadow: append($offsetShadow, $background, space);
52
+ $shadeShadow: append($shadeShadow, $shade, space);
53
+
54
+ text-shadow: $offsetShadow, $shadeShadow;
55
+ }
@@ -0,0 +1,11 @@
1
+ //////////////////////////////
2
+ // Printers-Shade Mixin, inspired by http://practice.typekit.com/lesson/using-shades/
3
+ // - $shade: The color for the shade
4
+ // - $from: Direction shadow comes from. Options are `top right`, `top left`, `bottom right`, `bottom left`
5
+ // - $distance: The distance you want the shadow to extend. Must be a positive integer
6
+ // - $size: The size you want each slice.
7
+ //////////////////////////////
8
+ @mixin printers-shade($shade, $from: 'top right', $distance: 10, $size: 0.005em) {
9
+
10
+ @include close-shade($shade, $shade, $from, $distance, $size);
11
+ }
@@ -0,0 +1,82 @@
1
+ //////////////////////////////
2
+ // Reverse-Shade Mixin, inspired by http://practice.typekit.com/lesson/using-shades/
3
+ // - $depth: The color for the depth shade
4
+ // - $shadow: The color for the shadow
5
+ // - $from: Direction shadow comes from. Options are `top right`, `top left`, `bottom right`, `bottom left`
6
+ // - $depth-distance: The distance you want the depth to extend. Must be a positive integer
7
+ // - $shadow-distance: The distance you want the shadow to extend. Must be a positive integer
8
+ // - $size: The size you want each slice.
9
+ //////////////////////////////
10
+ @mixin reverse-shade($depth, $shadow, $from: 'top right', $depth-distance: 25, $shadow-distance: 40, $size: .005em) {
11
+ $holder: ();
12
+
13
+ $Left: 0;
14
+ $Top: 0;
15
+
16
+ $LeftAdd: 0;
17
+ $TopAdd: 0;
18
+
19
+ @if type-of($from == 'list') {
20
+ $from: '#{$from}';
21
+ }
22
+
23
+ //////////////////////////////
24
+ // Left/Right
25
+ //////////////////////////////
26
+ @if str-index($from, 'right') {
27
+ $Left: $size * -1;
28
+ $LeftAdd: $size * -1;
29
+ }
30
+ @if str-index($from, 'left') {
31
+ $Left: $size;
32
+ $LeftAdd: $size;
33
+ }
34
+
35
+ //////////////////////////////
36
+ // Top/Bottom
37
+ //////////////////////////////
38
+ @if str-index($from, 'top') {
39
+ $Top: $size * 2;
40
+ $TopAdd: $size;
41
+ }
42
+ @else if str-index($from, 'bottom') {
43
+ $Top: $size * -2;
44
+ $TopAdd: $size * -1;
45
+ }
46
+
47
+ //////////////////////////////
48
+ // Shading
49
+ //////////////////////////////
50
+ @for $i from 1 through $depth-distance + $shadow-distance {
51
+ @if $i != 1 {
52
+ @if $i % 2 == 0 {
53
+ @if ($i <= $depth-distance) {
54
+ $Left: $Left + $LeftAdd;
55
+ }
56
+ @else {
57
+ $Left: $Left - $LeftAdd;
58
+ }
59
+
60
+ $Top: $Top - $TopAdd;
61
+ }
62
+ @else if $i % 2 == 1 {
63
+ $Top: $Top + ($TopAdd * 2);
64
+
65
+ }
66
+ }
67
+
68
+ $shadowHolder: ();
69
+
70
+ $shadowHolder: append($shadowHolder, $Left, space);
71
+ $shadowHolder: append($shadowHolder, $Top, space);
72
+ @if $i <= $depth-distance {
73
+ $shadowHolder: append($shadowHolder, $depth, space);
74
+ }
75
+ @else {
76
+ $shadowHolder: append($shadowHolder, $shadow, space);
77
+ }
78
+
79
+ $holder: append($holder, $shadowHolder, comma);
80
+ }
81
+ text-shadow: $holder;
82
+ }
@@ -0,0 +1,79 @@
1
+ //////////////////////////////
2
+ // Sandwich-Shade Mixin, inspired by http://practice.typekit.com/lesson/using-shades/
3
+ // - $cookie: The color for the "cookie"
4
+ // - $flavor: The color for the "ice cream"
5
+ // - $from: Direction shadow comes from. Options are `top right`, `top left`, `bottom right`, `bottom left`
6
+ // - $cookie-distance: The distance you want the cookie to extend. Must be a positive integer
7
+ // - $flavor-distance: The distance you want the flavor to extend. Must be a positive integer
8
+ // - $size: The size you want each slice.
9
+ //////////////////////////////
10
+ @mixin sandwich-shade($cookie, $flavor, $from: 'top right', $cookie-distance: 12, $flavor-distance: 29, $size: .005em) {
11
+ $holder: ();
12
+
13
+ $Left: 0;
14
+ $Top: 0;
15
+
16
+ $LeftAdd: 0;
17
+ $TopAdd: 0;
18
+
19
+ @if type-of($from == 'list') {
20
+ $from: '#{$from}';
21
+ }
22
+
23
+ //////////////////////////////
24
+ // Left/Right
25
+ //////////////////////////////
26
+ @if str-index($from, 'right') {
27
+ $Left: $size * -1;
28
+ $LeftAdd: $size * -1;
29
+ }
30
+ @if str-index($from, 'left') {
31
+ $Left: $size;
32
+ $LeftAdd: $size;
33
+ }
34
+
35
+ //////////////////////////////
36
+ // Top/Bottom
37
+ //////////////////////////////
38
+ @if str-index($from, 'top') {
39
+ $Top: $size * 2;
40
+ $TopAdd: $size;
41
+ }
42
+ @else if str-index($from, 'bottom') {
43
+ $Top: $size * -2;
44
+ $TopAdd: $size * -1;
45
+ }
46
+
47
+ //////////////////////////////
48
+ // Top Cookie
49
+ //////////////////////////////
50
+ @for $i from 1 through $cookie-distance * 2 + $flavor-distance {
51
+ @if $i != 1 {
52
+ @if $i % 2 == 0 {
53
+ $Left: $Left + $LeftAdd;
54
+ $Top: $Top - $TopAdd;
55
+ }
56
+ @else if $i % 2 == 1 {
57
+ $Top: $Top + ($TopAdd * 2);
58
+
59
+ }
60
+ }
61
+
62
+
63
+ $shadow: ();
64
+
65
+ $shadow: append($shadow, $Left, space);
66
+ $shadow: append($shadow, $Top, space);
67
+ @if $i > $cookie-distance and $i < $cookie-distance + $flavor-distance {
68
+ $shadow: append($shadow, $flavor, space);
69
+ }
70
+ @else {
71
+ $shadow: append($shadow, $cookie, space);
72
+ }
73
+
74
+ $holder: append($holder, $shadow, comma);
75
+ }
76
+
77
+ color: $cookie;
78
+ text-shadow: $holder;
79
+ }
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: letterform-shades
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Sam Richard
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sass
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 3.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.3.0
27
+ description: Awesome letterform shade mixins based on Typekit Practice's Using Shades
28
+ lesson (http://practice.typekit.com/lesson/using-shades/)
29
+ email:
30
+ - sam@snug.ug
31
+ executables: []
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - lib/letterform-shades.rb
36
+ - stylesheets/_letterform-shades.scss
37
+ - stylesheets/letterform-shades/_close-shade.scss
38
+ - stylesheets/letterform-shades/_offset-shade.scss
39
+ - stylesheets/letterform-shades/_printers-shade.scss
40
+ - stylesheets/letterform-shades/_reverse-shade.scss
41
+ - stylesheets/letterform-shades/_sandwich-shade.scss
42
+ homepage: https://github.com/snugug/letterform-shades
43
+ licenses:
44
+ - MIT
45
+ metadata: {}
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '1.2'
60
+ requirements: []
61
+ rubyforge_project: letterform-shades
62
+ rubygems_version: 2.0.14
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: Traditional Letterform Shades in Sass
66
+ test_files: []