New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Adding the letter to the class #2
Comments
Great idea. Something similar was mentioned in the blog comments. It's not without its challenges (i.e. apostrophes and other punctuation), but my brain is turning on this. Will likely make it into the next version with something like: but don't quote me on that. :) |
Apostrophes shouldn't be an issue, since there are no quotes to escape in the DOM ;-). And in the stylesheets, there are escape mechanisms. However, metaclasses, like letter-punctuation or so could prove useful. Apart from that: Thanks for the cool plugin! |
My fork of the plugin has this feature plus a few others. Take a look. It also supports non alpha-numeric characters by way of escaping the characters and then replacing the % sign with the letter u meaning an ampersand would get the class name |
@sanchothefat - Perfect! Save my day. |
Please also consider adding a class for each word:
|
If you need this functionality, check out @sanchothefat's fork https://github.com/sanchothefat/Lettering.js I'm personally not convinced that after a few years this needs to go into core. If you need this sorta functionality, you can hack it in (with mixed results), like so: $('#mything').lettering('words').children('span').each( function(){
$(this).addClass($(this).text().toLowerCase());
}); |
Sorry davatron5000, I deleted my old comment when I realised it's probably not necessary either - but I like your solution anyhow :) |
The plugin could be extended in the following way: To the char# class, add also a letter-X class, where X is the content of the span.
Example:
Current result:
Proposed result:
Side effects: Whitespace must be addressed specially.
Advantages: In the CSS you could address all 'A's at once, like, e.g., doing baseline shifting.
The text was updated successfully, but these errors were encountered: