Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 97 lines (83 sloc) 3.114 kb
6d043d0 @heygrady adding a compass mixin to make generating the required CSS easier.
authored
1 @import "compass/css3/text-shadow";
2 @import "compass/css3/user-interface";
3
4 @mixin jquery-text-shadow-base-styles {
5 .ui-text-shadow, .ui-text-shadow-original {
6 position: relative;
7 }
8 .ui-text-shadow-original {
9 z-index: 1;
10 text-shadow: none;
11 }
12 .ui-text-shadow-copy {
13 position: absolute;
14 z-index: 0;
15
81b741a @heygrady fixes #8 for when line-height is not default. Somehow I'd never teste…
authored
16 line-height: 110.74235%; // fixes #9
17
6d043d0 @heygrady adding a compass mixin to make generating the required CSS easier.
authored
18 // default positioning
19 left: 0;
20 top: 0;
81b741a @heygrady fixes #8 for when line-height is not default. Somehow I'd never teste…
authored
21 zoom: 1; // fixes #8 in IE7 and below
6d043d0 @heygrady adding a compass mixin to make generating the required CSS easier.
authored
22
23 // turn off shadow
24 text-shadow: none;
25
26 // turn off selection
27 @include user-select(none);
28 }
29 }
30
064c6a3 @heygrady adding support for multiple shadows. removing fix added for #8 becaus…
authored
31 @mixin jquery-text-shadow($shadow-1: default, $shadow-2: false, $shadow-3: false, $shadow-4: false, $shadow-5: false, $shadow-6: false, $shadow-7: false, $shadow-8: false, $shadow-9: false, $shadow-10: false) {
32 @if $shadow-1 == default {
33 $shadow-1: $default-text-shadow-color $default-text-shadow-h-offset $default-text-shadow-v-offset $default-text-shadow-blur;
6d043d0 @heygrady adding a compass mixin to make generating the required CSS easier.
authored
34 }
371f34a @heygrady #14 Using compass' compact() function to remove the default false sha…
authored
35
36 $shadows: compact($shadow-1, $shadow-2, $shadow-3, $shadow-4, $shadow-5, $shadow-6, $shadow-7, $shadow-8, $shadow-9, $shadow-10);
37
38 // for supported browsers
39 @include text-shadow($shadows...);
40
064c6a3 @heygrady adding support for multiple shadows. removing fix added for #8 becaus…
authored
41 $i: 1;
42 @each $shadow in $shadows {
371f34a @heygrady #14 Using compass' compact() function to remove the default false sha…
authored
43 $length: length($shadow);
44
45 // some defaults
46 $color: inherit;
47 $opacity: 100;
48 $offset-x: 0;
49 $offset-y: 0;
50 $blur-radius: 0;
51 $spread: 0; // IE10 only, not used
6d043d0 @heygrady adding a compass mixin to make generating the required CSS easier.
authored
52
371f34a @heygrady #14 Using compass' compact() function to remove the default false sha…
authored
53 // pull apart the individual arguments from the list
54 @if type-of(nth($shadow, 1)) == color {
55 // color first, blur optional, spread optional
56 @if $length >= 1 { $color: nth($shadow, 1); }
57 @if $length >= 2 { $offset-x: nth($shadow, 2); }
58 @if $length >= 3 { $offset-y: nth($shadow, 3); }
59 @if $length >= 4 { $blur-radius: nth($shadow, 4); }
60 @if $length == 5 { $spread: nth($shadow, 5); }
61 } @else {
62 // color last or missing, blur optional, spread optional
63 @if type-of(nth($shadow, $length)) == color {
64 $color: nth($shadow, $length);
064c6a3 @heygrady adding support for multiple shadows. removing fix added for #8 becaus…
authored
65 }
371f34a @heygrady #14 Using compass' compact() function to remove the default false sha…
authored
66 @if $length >= 1 { $offset-x: nth($shadow, 1); }
67 @if $length >= 2 { $offset-y: nth($shadow, 2); }
68 @if $length >= 3 {
69 @if type-of(nth($shadow, 3)) != color { $blur-radius: nth($shadow, 3); }
064c6a3 @heygrady adding support for multiple shadows. removing fix added for #8 becaus…
authored
70 }
371f34a @heygrady #14 Using compass' compact() function to remove the default false sha…
authored
71 @if $length >= 4 {
72 @if type-of(nth($shadow, 4)) != color { $spread: nth($shadow, 4); }
064c6a3 @heygrady adding support for multiple shadows. removing fix added for #8 becaus…
authored
73 }
74 }
371f34a @heygrady #14 Using compass' compact() function to remove the default false sha…
authored
75
76 // separate the color from the opacity
77 @if $color != inherit {
78 $opacity: round(alpha($color) * 100);
79 $color: rgb(red($color), green($color), blue($color));
80 }
81
82 // remove the unit from the radius
83 @if unit($blur-radius) == px {
84 $blur-radius: $blur-radius / 1px;
85 }
86
87 // for the jQuery text-shadow plug-in
88 .ui-text-shadow-copy-#{$i} {
89 color: $color;
90 filter: if( $opacity < 100, unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=#{$opacity})"), unquote("") )
91 if( $blur-radius > 0, unquote("progid:DXImageTransform.Microsoft.Blur(makeShadow=false,pixelRadius=#{$blur-radius})"), unquote("") );
92 left: $offset-x - $blur-radius;
93 top: $offset-y - $blur-radius;
94 }
95 $i: $i + 1;
6d043d0 @heygrady adding a compass mixin to make generating the required CSS easier.
authored
96 }
97 }
Something went wrong with that request. Please try again.