dioxus_tw_components/components/molecules/hovercard/
style.rs

1use super::props::*;
2use crate::attributes::*;
3use dioxus::prelude::*;
4
5impl Class for HoverCardProps {
6    fn base(&self) -> &'static str {
7        "group relative text-foreground"
8    }
9}
10
11impl Class for HoverCardTriggerProps {
12    fn base(&self) -> &'static str {
13        "text-sm font-medium whitespace-nowrap group-hover:underline transition-all"
14    }
15}
16
17impl Class for HoverCardContentProps {
18    fn base(&self) -> &'static str {
19        "p-4 bg-background whitespace-nowrap border border-border rounded-global-radius shadow-global-shadow z-30 opacity-100 absolute mt-2 data-[state=inactive]:invisible"
20    }
21
22    fn animation(&self) -> Option<&'static str> {
23        Some(match *self.animation.read() {
24            Animation::None => "",
25            Animation::Light | Animation::Full => {
26                "transition-all duration-100 data-[state=inactive]:scale-90 data-[state=active]:scale-100 data-[state=inactive]:opacity-0"
27            }
28        })
29    }
30}