pub struct State {
pub themes: IndexMap<String, ThemeEntry>,
pub default_theme: String,
pub current_theme: String,
pub theme_variables: IndexMap<String, IndexMap<String, String>>,
pub variables: IndexMap<String, String>,
pub breakpoints: IndexMap<String, String>,
pub used_selectors: IndexSet<String>,
pub used_classes: IndexSet<String>,
}Fields§
§themes: IndexMap<String, ThemeEntry>§default_theme: String§current_theme: String§theme_variables: IndexMap<String, IndexMap<String, String>>§variables: IndexMap<String, String>§breakpoints: IndexMap<String, String>§used_selectors: IndexSet<String>§used_classes: IndexSet<String>Implementations§
Source§impl State
impl State
pub fn new_default() -> Self
Sourcepub fn default_state() -> Self
pub fn default_state() -> Self
Public helper to access the embedded default state.
pub fn set_theme(&mut self, theme: impl Into<String>) -> Result<(), Error>
pub fn add_theme(&mut self, name: impl Into<String>, styles: SelectorStyles)
pub fn set_variables(&mut self, vars: IndexMap<String, String>)
pub fn set_breakpoints(&mut self, map: IndexMap<String, String>)
pub fn set_default_theme(&mut self, name: impl Into<String>)
pub fn register_selectors<I: IntoIterator<Item = String>>( &mut self, selectors: I, )
pub fn register_tailwind_classes<I: IntoIterator<Item = String>>( &mut self, classes: I, )
pub fn clear_usage(&mut self)
pub fn to_json(&self) -> Value
pub fn from_json(value: Value) -> Result<Self>
pub fn css_for_web(&self) -> String
pub fn rn_styles_for( &self, selector: &str, classes: &[String], ) -> IndexMap<String, Value>
pub fn effective_breakpoints(&self) -> IndexMap<String, String>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for State
impl<'de> Deserialize<'de> for State
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)