You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,16 +19,16 @@ After including jQuery, [download and include the minified version of Lettering.
19
19
The resulting code will churn your `.fancy_title` and output the following:
20
20
21
21
<h1 class="fancy_title">
22
-
<span class="char1 charS">S</span>
23
-
<span class="char2 charo">o</span>
24
-
<span class="char3 charm">m</span>
25
-
<span class="char4 chare">e</span>
26
-
<span class="char5 char_"> </span>
27
-
<span class="char6 charT">T</span>
28
-
<span class="char7 chari">i</span>
29
-
<span class="char8 chart">t</span>
30
-
<span class="char9 chal">l</span>
31
-
<span class="char10 chare">e</span>
22
+
<span class="char1 char-S">S</span>
23
+
<span class="char2 char-o">o</span>
24
+
<span class="char3 char-m">m</span>
25
+
<span class="char4 char-e">e</span>
26
+
<span class="char5 char-32"> </span>
27
+
<span class="char6 char-T">T</span>
28
+
<span class="char7 char-i">i</span>
29
+
<span class="char8 char-t">t</span>
30
+
<span class="char9 char-l">l</span>
31
+
<span class="char10 char-e">e</span>
32
32
</h1>
33
33
34
34
Magical. Now the text is easy to manipulate in your CSS using an ordinal `.char#` pattern. This plugin assumes basic counting skills, but it's a pretty fast and easy way to get control over every letter.
@@ -57,10 +57,10 @@ Here's an example of the `.lettering('words')` method:
57
57
Which will generate:
58
58
59
59
<p class="word_split">
60
-
<span class="word1 wordDont">Don't</span>
61
-
<span class="word2 wordbreak">break</span>
62
-
<span class="word3 wordmy">my</span>
63
-
<span class="word4 wordheart">heart.</span>
60
+
<span class="word1 word-Don39t">Don't</span>
61
+
<span class="word2 word-break">break</span>
62
+
<span class="word3 word-my">my</span>
63
+
<span class="word4 word-heart46">heart.</span>
64
64
</p>
65
65
66
66
You can then style each word using the `.word#` class.
@@ -79,9 +79,9 @@ Once word wrapping was complete, we noticed the need for yet another method, one
As expected it uses the `.line#` ordinal pattern. You'll also notice the `<br>`'s have been destructively ripped out. In your CSS, you'll want to declare something like `.line_split span { display:block; }` if you need them to behave as a `<br>` element.
@@ -90,7 +90,7 @@ As expected it uses the `.line#` ordinal pattern. You'll also notice the `<br>`
90
90
We've found this to be a pretty quick and elegant solution to create typographical CSS3 posters. It's also a great solution for really custom type headings, while keeping the text selectable.
91
91
92
92
### Best Practices
93
-
Be smart and use sparingly. You'll probably break your browser if you try to tried to do wrap every letter on your page in a `span` tag, so don't do that. Look to use this in your Headings, Blockquotes, Asides, etc.
93
+
Be smart and use sparingly. You'll probably break your browser if you try to wrap every letter on your page in a `span` tag, so don't do that. Look to use this in your Headings, Blockquotes, Asides, etc.
94
94
95
95
### Kern Well
96
96
If you're going through the trouble to load a fancy font and that word or phrase is the largest on the site, then it's important for it to be kerned well. With Lettering.js, kerning is a breeze. You can simply use `$("#id-of-what-i-want-to-kern").lettering();` and then on each `.char#`, you can set relative position or left/right margin. Works like a charm.
0 commit comments