pub struct Theme { /* private fields */ }Expand description
Values for tokens across the whole page, written on :root.
Implementations§
Source§impl Theme
impl Theme
Sourcepub fn set<T: TokenValue>(self, token: &Token<T>, value: impl Into<T>) -> Self
pub fn set<T: TokenValue>(self, token: &Token<T>, value: impl Into<T>) -> Self
Sets token to value. A later value for the same token under the
same conditions replaces an earlier one.
Sourcepub fn on(self, media: Media, theme: Self) -> Self
pub fn on(self, media: Media, theme: Self) -> Self
Adds the values of theme, applied only under media.
Sourcepub fn merge(self, theme: Self) -> Self
pub fn merge(self, theme: Self) -> Self
Adds the values of theme, which win over this theme’s own.
Sourcepub fn to_css(&self) -> String
pub fn to_css(&self) -> String
The theme as a stylesheet in TOKEN_LAYER: the unconditioned values
first, then one block per set of media conditions, in the order
Media lists them.
Trait Implementations§
impl StructuralPartialEq for Theme
Auto Trait Implementations§
impl Freeze for Theme
impl RefUnwindSafe for Theme
impl Send for Theme
impl Sync for Theme
impl Unpin for Theme
impl UnsafeUnpin for Theme
impl UnwindSafe for Theme
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