Skip to content

Commit

Permalink
making notes about multiple shadows clearer.
Browse files Browse the repository at this point in the history
  • Loading branch information
heygrady committed Apr 27, 2012
1 parent a8250b4 commit 1ec8035
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions readme.md
@@ -1,9 +1,10 @@
# Text Shadow # Text Shadow
This library is a `text-shadow` polyfill for Internet Explorer 9 and below. It uses the Microsoft proprietary [blur filter](http://msdn.microsoft.com/en-us/library/ms532979(v=vs.85\).aspx) and the [alpha filter](http://msdn.microsoft.com/en-us/library/ms532967(v=vs.85\).aspx) along with layering to closely approximate `text-shadow`. This library is a `text-shadow` polyfill for Internet Explorer 9 and below. It uses the Microsoft proprietary [blur filter](http://msdn.microsoft.com/en-us/library/ms532979(v=vs.85\).aspx) and the [alpha filter](http://msdn.microsoft.com/en-us/library/ms532967(v=vs.85\).aspx) along with layering to closely approximate `text-shadow`.


* currently only pixel units are supported * Currently only pixel units are supported
* cutting and pasting text will result in doubled text * Cutting and pasting text will result in doubled text
* the creation of the extra DOM nodes could potentially be faster * The creation of the extra DOM nodes could potentially be faster
* Multiple shadows are not supported. Only the first shadow will be rendered.


## Usage ## Usage
It is recommended to use this library with a feature detection library such as [Modernizr](http://www.modernizr.com/docs/#textshadow). It is recommended to use this library with a feature detection library such as [Modernizr](http://www.modernizr.com/docs/#textshadow).
Expand All @@ -19,17 +20,17 @@ if (!Modernizr.textshadow) {
// normal // normal
$('h1').textshadow('2px 2px 2px #000'); $('h1').textshadow('2px 2px 2px #000');


// multiple shadows
$('h1').textshadow('2px 2px 2px #0f0, 4px 4px 2px #f00, 6px 6px 2px #00f');

// rgba // rgba
$('h1').textshadow('2px 2px 2px rgba(0, 0, 0, 0.5)'); $('h1').textshadow('2px 2px 2px rgba(0, 0, 0, 0.5)');


// hsla // hsla
$('h1').textshadow('2px 2px 2px hsla(0, 100%, 54%, .5)'); $('h1').textshadow('2px 2px 2px hsla(0, 100%, 54%, .5)');

// multiple shadows (currently not fully supported)
$('h1').textshadow('2px 2px 2px #0f0, 4px 4px 2px #f00, 6px 6px 2px #00f');
} }
``` ```

### Required CSS ### Required CSS
There is a corresponding css file that provides base styles for the new elements used. It must be included in the document as well. Optionally, but recommended for ease-of-use, you could use the Compass mixin ([detailed below](#using-sass-and-compass)) instead of the CSS file. There is a corresponding css file that provides base styles for the new elements used. It must be included in the document as well. Optionally, but recommended for ease-of-use, you could use the Compass mixin ([detailed below](#using-sass-and-compass)) instead of the CSS file.


Expand Down Expand Up @@ -62,7 +63,6 @@ For performance and flexibility reasons, it's best to use CSS rather than JS to
<html> <html>
<head> <head>
... ...

<link rel="stylesheet" href="jquery.textshadow.css"> <link rel="stylesheet" href="jquery.textshadow.css">
<style> <style>
h1 { h1 {
Expand Down

0 comments on commit 1ec8035

Please sign in to comment.