stylist-rs
stylist-rs copied to clipboard
Do we support defining pseduo class with this library?
As the title, there is no documentation i can find about how to use pseduo class in stylist-rs.
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.
@WorldSEnder Thanks, but it's still not very clear to me, could you put an example into the directory examples
of this repository?
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?