Lettering.js icon indicating copy to clipboard operation
Lettering.js copied to clipboard

Common css class for all items

Open hamsterbacke23 opened this issue 8 years ago • 2 comments

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...

hamsterbacke23 avatar Apr 19 '16 13:04 hamsterbacke23

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] { }

davatron5000 avatar Apr 19 '16 15:04 davatron5000

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

hamsterbacke23 avatar Apr 19 '16 16:04 hamsterbacke23