Lettering.js
Lettering.js copied to clipboard
Common css class for all items
Especially in menus it's really hard to get to the character elements with only "outside" selectors, so a common selector for all would be great...
This isn't bad and I could see having the klass
there as helpful. But what do you mean by "hard"? Do you have a CodePen example?
I can think of a couple of ways to do this without adding to the plugin:
.menuItem > span { }
[class^=char] { }
Hi, thanks for your reply...
Usually I try to avoid wildcard or regex selectors because I'm not sure about their performance, and they are not very explicit, although I think it's not a big issue most of the time.
What I mean by "hard" is when I have nested structures like menus and I want to target only second level spans, but not third level spans ...
I want to write something like this: .level-2 .char { ... } .level-3 .char { ... }
and not something like .level-2 > li > a > span .level-2 > li > .level-3 li a span { ... }
Of course that is all possible, just not very convenient...
http://codepen.io/hamsterbacke82/pen/PNaWzv