Skip to content
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

Common css class for all items #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hamsterbacke23
Copy link

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

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...
@davatron5000
Copy link
Owner

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

@hamsterbacke23
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants