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

Do we support defining pseduo class with this library? #85

Open
Mng12345 opened this issue Aug 18, 2022 · 3 comments
Open

Do we support defining pseduo class with this library? #85

Mng12345 opened this issue Aug 18, 2022 · 3 comments
Labels
waiting for author Needs further info from issue creator

Comments

@Mng12345
Copy link

As the title, there is no documentation i can find about how to use pseduo class in stylist-rs.

@WorldSEnder
Copy link
Collaborator

Yes, this is supported. E.g. in a styled component

let hover_class = css!(
  :hover {
      color: blue;
  }
);

You can think of all selectors in a css! block to implicitly mention "the currently generated class", so the above results in css like

.stylist-style-0:hover {
    color: blue;
}

being mounted the <head> and using the hover_class will attach the class stylist-style-0 to your component.

@Mng12345
Copy link
Author

Mng12345 commented Aug 19, 2022

@WorldSEnder Thanks, but it's still not very clear to me, could you put an example into the directory examples of this repository?

@WorldSEnder
Copy link
Collaborator

Can you give a short description what you are trying to achieve and which pseudo class you would like to see, so I can provide a tailored example?

@WorldSEnder WorldSEnder added the waiting for author Needs further info from issue creator label Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for author Needs further info from issue creator
Projects
None yet
Development

No branches or pull requests

2 participants