pub struct CardStyle {
pub background: Color,
pub border: Border,
pub radius: Radius,
pub shadows: Vec<BoxShadow>,
pub padding: f32,
}Expand description
Fully resolved visual style for a Card.
Dimensions are logical pixels. Only the top border width/color and top-left radius are currently forwarded to the underlying uniform container; callers should therefore use uniform borders and radii for predictable rendering.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{CardStyle, CardVariant};
let style = CardStyle::from_theme(Theme::dark(), CardVariant::Elevated);
assert_eq!(style.shadows.len(), 1);
assert!(style.padding >= 0.0);Fields§
§background: ColorCard fill color.
border: BorderCard border; use uniform widths and colors.
radius: RadiusCard corner radii; use a uniform value for current rendering.
shadows: Vec<BoxShadow>Shadows painted in vector order by the backing container.
padding: f32Inner padding on every edge, in logical pixels.
Implementations§
Source§impl CardStyle
impl CardStyle
Sourcepub fn from_theme(theme: Theme, variant: CardVariant) -> Self
pub fn from_theme(theme: Theme, variant: CardVariant) -> Self
Resolves variant against theme into concrete colors and metrics.
Surface and Outline have no shadows, Elevated has one medium
shadow, and Accent has one accent-colored glow.
§Examples
use ailloli_ui_core::{Color, Theme};
use ailloli_ui_widgets::controls::{CardStyle, CardVariant};
let style = CardStyle::from_theme(Theme::dark(), CardVariant::Outline);
assert_eq!(style.background, Color::TRANSPARENT);
assert!(style.shadows.is_empty());Trait Implementations§
impl StructuralPartialEq for CardStyle
Auto Trait Implementations§
impl Freeze for CardStyle
impl RefUnwindSafe for CardStyle
impl Send for CardStyle
impl Sync for CardStyle
impl Unpin for CardStyle
impl UnwindSafe for CardStyle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.