pub struct StyleSource { /* private fields */ }Expand description
A struct that can be used as a source to create a Style or
GlobalStyle.
This struct is usually created by css! macro.
You can also get a StyleSource instance from a string or a Sheet by calling .into().
use stylist::yew::Global;
use stylist::{css, StyleSource};
use yew::prelude::*;
let s: StyleSource = css!("color: red;");
let rendered = html! {<div class={s.clone()} />};
let global_rendered = html! {<Global css={s} />};Trait Implementations§
Source§impl Clone for StyleSource
impl Clone for StyleSource
Source§fn clone(&self) -> StyleSource
fn clone(&self) -> StyleSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StyleSource
impl Debug for StyleSource
Source§impl From<Sheet> for StyleSource
impl From<Sheet> for StyleSource
Source§fn from(sheet: Sheet) -> StyleSource
fn from(sheet: Sheet) -> StyleSource
Converts to this type from the input type.
Source§impl From<StyleSource> for Classes
Available on crate feature yew only.
impl From<StyleSource> for Classes
Available on crate feature
yew only.Source§fn from(style_src: StyleSource) -> Self
fn from(style_src: StyleSource) -> Self
Converts to this type from the input type.
Source§impl FromStr for StyleSource
Available on crate feature parser only.
impl FromStr for StyleSource
Available on crate feature
parser only.Source§impl IntoPropValue<Classes> for StyleSource
Available on crate feature yew only.
impl IntoPropValue<Classes> for StyleSource
Available on crate feature
yew only.Source§fn into_prop_value(self) -> Classes
fn into_prop_value(self) -> Classes
Convert
self to a value of a Properties struct.Source§impl<'a> IntoPropValue<StyleSource> for &'a str
Available on crate feature parser only.
impl<'a> IntoPropValue<StyleSource> for &'a str
Available on crate feature
parser only.Source§fn into_prop_value(self) -> StyleSource
fn into_prop_value(self) -> StyleSource
Convert
self to a value of a Properties struct.Source§impl<'a> IntoPropValue<StyleSource> for Cow<'a, str>
Available on crate feature parser only.
impl<'a> IntoPropValue<StyleSource> for Cow<'a, str>
Available on crate feature
parser only.Source§fn into_prop_value(self) -> StyleSource
fn into_prop_value(self) -> StyleSource
Convert
self to a value of a Properties struct.Source§impl IntoPropValue<StyleSource> for Sheet
Available on crate feature yew only.
impl IntoPropValue<StyleSource> for Sheet
Available on crate feature
yew only.Source§fn into_prop_value(self) -> StyleSource
fn into_prop_value(self) -> StyleSource
Convert
self to a value of a Properties struct.Source§impl IntoPropValue<StyleSource> for String
Available on crate feature parser only.
impl IntoPropValue<StyleSource> for String
Available on crate feature
parser only.Source§fn into_prop_value(self) -> StyleSource
fn into_prop_value(self) -> StyleSource
Convert
self to a value of a Properties struct.Source§impl PartialEq for StyleSource
impl PartialEq for StyleSource
Source§impl<'a> TryFrom<&'a str> for StyleSource
Available on crate feature parser only.
impl<'a> TryFrom<&'a str> for StyleSource
Available on crate feature
parser only.Source§impl TryFrom<String> for StyleSource
Available on crate feature parser only.
impl TryFrom<String> for StyleSource
Available on crate feature
parser only.impl StructuralPartialEq for StyleSource
Auto Trait Implementations§
impl Freeze for StyleSource
impl !RefUnwindSafe for StyleSource
impl !Send for StyleSource
impl !Sync for StyleSource
impl Unpin for StyleSource
impl !UnwindSafe for StyleSource
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.Source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.